My strings are formatted like this:
#WTK-56491650H #=> want to capture '56491650H'
#M123456 #=> want to capture 'M123456'
I am trying to extract everything after the # character, unless there is a dash. In that case, I only want to capture what comes after the dash. I have been experimenting with JavaScript regex conditionals, but I can't seem to get it right. The current expression only matches what's after the # and nothing else.
Here is my current regex pattern:
/((?=-{1})-(.+)|(?!-{0)#(.+))/
You can view a demo here.