question
question

Reputation: 11

regex to replace everything after period with nothing

I want to remove everything comes after " . " with nothing using simple regex on notepad++ It seems to be really simple one. I tried with regex "..*$" but no luck. Eg: 129.435456 I would like to replace everything after . and get just 129

Upvotes: 1

Views: 7694

Answers (2)

Jimmy
Jimmy

Reputation: 1

Try without quotes in Notepad++ making sure you select "Regular expression" radio button in the bottom. Works great!

Upvotes: 0

Kasravnd
Kasravnd

Reputation: 107347

Since dot is a regex character (match one character) you need to escape the first dot :

"\..*$"

Upvotes: 4

Related Questions