I need your help regarding RegexMatch (c#) for file endings:
I need always the number between the extension .html and before the first minus (if you read from right to left)
example:
-213.html
looking for 213
-93-32.html
looking for 32
I tried already -([^\”]*).html, but in the secone example it gives me -93-32 back.
(btw. with my current solution above, i also get the minus, if you know how i can exlude it, please let me know, currently i’m doing a replace “-” with “” afterwards)
Thanks in advance,
Ralf
(\d+)\.html$should do it. here$means end of the line anchor.If you dont want to capture
.htmluse(\d+)(?:\.html)$( haven’t tested it though ).Without anchor, if you read left to right, it would be
-(\d+)\.html