I have strings like this:
#WTK-56491650H #=> want to capture '56491650H'
#M123456 #=> want to capture 'M123456'
Here's a solution which uses non-capturing groups
(?:stuff) which I prefer so I don't have to dig through the result groups to find the string I'm interested in.
First it throws out the
# character, then throws out the stuff up to and including the
- character, if it is there, then groups the rest as your match.