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 left
into your lookbehind:
((?<=left/)[0-9]{10}?)
In your first example, you match left
then the regex engine's 'pointer' is between t
and /
, so your lookbehind cannot match, because the regex engine has not passed the slash yet.