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
BekahHW -
Sharon Sinei -
BekahHW -
Thomas Bnt -
Once suspended, mmphego will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, mmphego will be able to comment and publish posts again.
Once unpublished, all posts by mmphego will become hidden and only accessible to themselves.
If mmphego is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to Mpho Mphego.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community 👩💻👨💻 safe. Here is what you can do to flag mmphego:
Unflagging mmphego will restore default visibility to their posts.
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.