简体   繁体   中英

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 (XX 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM