Example strings:
DFDBDFDFDF21R123
DFDBDFDFDF21DFD
I need a regex that when run matches ths following:
R123
DFD
(no EOL chars)
Thanks, I hope there is a simple solution that my brain isn't conjuring.
Example strings:
DFDBDFDFDF21R123
DFDBDFDFDF21DFD
I need a regex that when run matches ths following:
R123
DFD
(no EOL chars)
Thanks, I hope there is a simple solution that my brain isn't conjuring.
/^.{12}(.*)$/
The first part will look for the first 12 characters and throw them out, and the second part will group the rest.
Edit: as others have pointed out, you really should just use substring in whatever language you're using. Regex is overkill.
/.{12}(.*)/
Match the first 12 chars, then match the rest.
But I agree with @chance: substr
would be better.
I would suggest using a substring function in your language instead.
If you REALLY want a regex solution, in spite of it being about a hundred times slower and more complex than you really need, try something like this:
/.{12}(.*)/
Your desired result is then in the first capture group.