I have such input string:
left/1234567890
regular expression:
(left(?<=/)[0-9]{10}?)
I want to get such result: 1234567890.
But it doesn’t work.
Although, the next input string:
/1234567890
with the next regular expression:
((?<=/)[0-9]{10}?)
get result as expected: 1234567890.
This is because you did not include
leftinto your lookbehind:In your first example, you match
leftthen the regex engine’s ‘pointer’ is betweentand/, so your lookbehind cannot match, because the regex engine has not passed the slash yet.