Positive lookahead
If I try to use positive lookahead to search for '&', it doesn't seem to work.
(?=&)
Yet, If i use 'and', it works fine.
(?=and)
I am trying to match either '&' OR 'and' in a string.
'&' Does not appear to be a control character, so i'm mystified.
(this was using https://regex101.com/ and set to PCRE)
Does anyone know why this happens?
(?=&)
Yet, If i use 'and', it works fine.
(?=and)
I am trying to match either '&' OR 'and' in a string.
'&' Does not appear to be a control character, so i'm mystified.
(this was using https://regex101.com/ and set to PCRE)
Does anyone know why this happens?
Reply to #1:
I don't know if this will help but have you tried escaping it like this \& ?
I don't know if this will help but have you tried escaping it like this \& ?
Reply to #2:
Yes, I tried escaping but it didnt seem to work. Thankyou for the reply though!
Regex is difficult :)
Yes, I tried escaping but it didnt seem to work. Thankyou for the reply though!
Regex is difficult :)