Hi all,
I'm doing some coding with regular expressions, but there are a couple of things I can't understand. Look at the following
1. searching the letter 'r' followed by a number:
regexp('19f/4r power shift','(?<=\d*) ?r')ans = 6 12regexp('19f/4r power shift','(?<=\d)\s?r')ans = 6
Why the '*' change so much the result? The 'r' at the 12th position is not followed by any number.
2- Searching for the word 'Reverser' that is not preceded by the words 'power' or 'powr'.
regexp('power Reverser','(?<!powe?r) *-? *Reverser','match')ans = ' Reverser'
Reverser is preceded by the string 'power', so it shouldn't be selected.
Why do these occur?
Thanks
Best regards,
Pietro
Best Answer