mahmood
mahmood

Reputation: 24795

Using regex in notepad++

I have a text file which contains some lines this

something1 1.2 MB
something2 5.3 MB

I want to remove (X.X MB), so I did this in notepad++

find what : *.*[ MB]

replace with:

Regular expression

But it says invalid regular expression. How can I fix that?

Upvotes: 1

Views: 901

Answers (1)

Jerry
Jerry

Reputation: 71598

You might try:

Find:

 \d*\.\d* MB

(yes, there's a space before the first \d).

Replace with nothing.

\d stands for a digit in regex, and you need to escape the dot since the dot is a wildcard in regex. * is an operator and means 0 or more times. The square brackets is a character class and would otherwise match any one of space, M or B. Just remove them here.

Upvotes: 2

Related Questions