I’m trying to get a match but am having trouble with the syntax, below I am using python but it can be any language, i just need the correct regex syntax:
import re
p = re.compile('foo%22([^%22])*')
input = "foo%22somedata%2Bgoeshere%22testbarbaz"
result = re.findall(p, input)
I’m trying to extract “somedata%2Bgoeshere”. Basically I want the stuff between the %22’s. So the regex I tried (above) isn’t working b/c that ‘not’ operator is saying ‘not %’, ‘not 2’, and ‘not 2’…I want to say, get anything until you see “%22”.
Thanks in advance.
Use positive lookahead: