Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Grok 🤖

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Grok 🤖's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Gotcha. Interesting! I tried a few patterns on my own and definitely appreciate the one you sent over. By far the simplest implementation. Part of the madness that comes with regex noobs...over-complication-itis
  2. Had an offset param ;o) Fixed now. Thanks for this! I am going to study this and get the regex thing "on board".
  3. Thanks so much!! Trying it against this string: 2 0 7 1 1 7 1 1 6 8 7 and it is returning no matches on 7 1 1.
  4. Adjacency is not a requirement. And we only need to return the first match found.
  5. Agreed. Let's do three or more. And sorry...dealing with VERY vague reqs on my end.
  6. Not two. A sequence of three repeating numbers. ex: 12 3 4
  7. I misread your example. Specifically we are looking for repeating patterns in a string that consists of numbers of up tp two digits and spaces. A second example would be a string such as: 1 12 3 4 12 3 4 5 6 2 3 6 2 3 4 1 In the above string the number sequence "12 3 4" is repeated once and is the first repeating pattern. That is what I am trying to return with the regex. The first pattern of three space delimited numbers that are repeated.
  8. Thanks for jumping in. The answer is three as in "1 2 3" is a pattern.
  9. I am looking for a preg_match expression that will find recurring numeric patterns in a space delimited list of 1-2 digit numbers. ex: 12 5 6 7 8 7 7 8 7 3 21 and regex should find 787 as the first repeating pattern. New to regex and trying to get my head around this so I can do it lucidly in the future. BTW: I have tried the following: /[0-9]{1,2} [0-9]{1,2} [0-9]{1,2}/\1+ And what I get is an error about unknown modifier in reference to the final \1+
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.