Sorry doing this the fast way of asking all the regex experts out there :)
What regex for C# can I use that matches the end of a word + some number
Eg. End of string matches with "Story" + 0 or more numbers
"ThisIsStory1" = true
"ThisIsStory2000" = true
"ThisIsStory" = true
"Story1IsThis" = false
"IsStoryThis1" = false
Hope this makes sense
A regular expression that I could plug into C# would be fantastic.
Thanks
You'll need something like this Story[0-9]*$
So it matches for story (ignoring anything before it, you may need to add more), then for 0 or more numbers between story and the end of the string.
Try [A-Za-z]*Story[0-9]*
.
If you want to check against a whole line, ^[A-Za-z]*Story[0-9]*$
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With