Hi, I have been trying to get this regex work. Suppose to parse an URL, if the string '_skipThis' is found, don't match the string. Also backreferences are needed too. For example:
String 1: a_particular_part_of_string/a/b/c/d/e/f
Result: preg_match should return true
Backreference: $1 -> a_particular_part_of_string, $2 -> /a/b/c/d/e/f
String 2: a_particular_part_of_string_skipThis/a/b/c/d/e/f
Result: preg_match should return false.
Backreference: nothing here.
I have tried the following regex..
reg1 = ([a-zA-Z0-9_]+)(\/.*)
reg2 = ([a-zA-Z0-9]+(?!_skipThis))(\/.*)
reg3 = ((?!_skipThis).*)(\/.*)
reg4 = ((?!_skipThis)[a-zA-Z0-9_]+)(\/.*)
Please help me! Thanks in advance!!!