Reputation: 545
I have something like that
test/pull/1
test/pull/2
My goal is to grab
1
2
Closest I got is this, any help appreciated:
(?<=pull\/\s)(\w+)
Upvotes: 0
Views: 400
Reputation: 473
You can simply use this one:
([^\/]+$)
or if you are expecting non-digit characters:
(?<=pull\/).*$
And as mentioned in the comments, the .* will match till the end of the string, which might be too much. Even better:
(?<=pull\/)\w+
Upvotes: 1
Reputation: 728
test/pull/([0-9]{1,})
if test/pull/
is your unique identifier
pull/([0-9{1,}])
if your pull
is your unique identifier
test/pull/([0-9a-zA-Z]{1,})
if your try to capture alphanumeric more than 1
([0-9a-zA-Z]{1,})$
if you don't know what your unique identifier is but you know it's always in the end of the word, and the text is alphanumeric
Upvotes: 2