Given these URLs:
1: http:
2: http:
3: http:
I wrote this expression that will be applied to the last segment of the URL :
(?(?<=set[\d])([\d]+)|([^/]+))
What I would like to do is to catch every digit followed by “set” only if the URL segment starts with “set” and the number immediately after; otherwise, I want to use the entire segment (excluding slashes).
As I wrote this regular expression, it matches any character that is not a "/". I think I am doing something wrong in the test statement. Can someone point me right?
thank
UPDATE
Thanks to the Josh tab, I played around a bit and found that this option suits me better:
set-(?P<number>[0-9]+)|(?P<segment>[^/]+)