Reputation: 2057
I have a string that is something like "Hello 9 you8 [C#587]"
or "Hello 9 you8 [#587]"
I need to check if the string contains "[#numbers]"
or "[letter#numbers]"
using a regular expression in C#.
Please assist.
kind regards
In actual fact the "letter" part might be a word.
Please help as per update.
Thanks
Upvotes: 0
Views: 203
Reputation: 8908
I belive you want something slightly different to @hsz's answer. His will only check the [letter#numbers]
and not the [#numbers]
.
Try this:
\[[a-zA-Z]?#\d+\]
Upvotes: 0