Gatebutch
Gatebutch

Reputation: 13

Replace string with the same start and end in notepad++

Not much of a expert in regular expression here. My IT colleague dump my a text file which containt all our mailing list. But I need to clean it before using it.

I need to find and delete a string of text which always start by "3EA" and finish by "////".

I try several ways, but no cigars.

Here's some example of the string I need to delete :

3AEAEACjkCjm////
3AEAEACjlCjn////
3AEAEACjnCjp////

Thanks

Upvotes: 1

Views: 2924

Answers (3)

kos
kos

Reputation: 876

Assuming there are always 9 alphabetical characters in between 3AE and ////, in search and replace (in regex mode) replace this pattern with a blank pattern:

3AE[A-Za-z]{9}////

Upvotes: 1

vks
vks

Reputation: 67968

3AE[a-zA-Z]{9}/{4}

Try this.See demo.

https://regex101.com/r/vN3sH3/61

Upvotes: 3

Avinash Raj
Avinash Raj

Reputation: 174706

You could use the below regex,

3EA\S*?////

Add anchors if necessary.

^3EA\S*?////$

Upvotes: 1

Related Questions