string = 'R31.99Save\xa05.00'
I would like to strip only 'R31.99' using regular expressions.
Using regular expressions, can someone help on how would I do this?
string = 'R31.99Save\xa05.00'
I would like to strip only 'R31.99' using regular expressions.
Using regular expressions, can someone help on how would I do this?
For further actions, you may consider blocking this person and/or reporting abuse
Lucas Chitolina -
Chris Jarvis -
Oliver Bennet -
Alexander Shagov -
Top comments (3)
If you are sure about the string being Save you can just use string.split('Save')[0] to get the token you need.
Found a solution:
If that first character is only ever going to be a single
'R'
, you can replace the[R]+
in the regex with justR
:Any character in the pattern that doesn't have some special regex meaning will match the character itself.