Alien Xu
Alien Xu

Reputation: 193

regex check if string is end with whitespace

http://www.example.com data:blaefrferter 
http://www.example.com data:blaefrferter 
http://www.example.com data:blaefrferter 

I want get rid of the data:blaefrferter using regex, I've tried this ^.*$\s but it doesn't match, what is my mistake?

Upvotes: 0

Views: 86

Answers (2)

Toto
Toto

Reputation: 91488

How about:

Find what: \s+\S+\s*
Replace with: NOTHING

Upvotes: 1

DAXaholic
DAXaholic

Reputation: 35368

In sublime enter ([^ ]*).*$ for Find What: and $1 for Replace With:

enter image description here

Upvotes: 1

Related Questions