Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regex to match dollar sign and following spaces

Tags:

regex

As the title says, I need to create a regex that matches $ and any following space after it. Example:

"asd $   5" should match "$   ".

Is is possible? I could find anything like that.

like image 274
Luis felipe De jesus Munoz Avatar asked Jan 28 '23 19:01

Luis felipe De jesus Munoz


1 Answers

You may use the following regex:

[$]\s+

[$] will match the dollar sign, and \s+ will match one or more spaces after the dollar sign.

See test example here: https://regex101.com/r/Y4j98L/1

like image 76
kiner_shah Avatar answered Feb 12 '23 00:02

kiner_shah