NotePad++ Regex

Post Reply
User avatar
janus
Posts: 407
Joined: Sat Aug 06, 2022 2:05 pm
Has thanked: 684 times
Been thanked: 832 times

NotePad++ Regex

Post by janus »

:teasing-signhere: :text-welcomewave:

OK need help here .. I used to be able to do this using NotePad++ but forgot how to do it plus cant find the text file that had the instructions (par for MY course).

[PlyCount "65"]
[TimeControl "240+1"]

{AMD A10-9700 RADEON R7, 10 COMPUTE CORES 4C+6G 3493 MHz W=32.2 plies; 468kN/s;
91 TBAs; OliBiyu_S10_3.ctg B=32.1 plies; 446kN/s; 101 TBAs; OliBiyu_S10_3.ctg}


1. g3 {[%eval 0,0] [%emt 0:00:00]} e5 {[%eval 0,0] [%emt 0:00:00]} 2. c4 {


The above is from Oliprog's PGN file - I want the blue section removed.
I was able to do this quite easily once upon a time.

Any ideas anybody .. please .. :bow-blue:
FritzUser
Posts: 61
Joined: Thu Dec 01, 2022 3:21 am
Has thanked: 139 times
Been thanked: 154 times

Re: NotePad++ Regex

Post by FritzUser »

Maybe something like:

Code: Select all

^\{.*\}$\n\n1.
and replace it with

Code: Select all

1.
The ^ means start of line. The \{ and \} are escaped. $ means end of line, and \n of course is a UNIX newline. If in WIndows, it's \r\n.

Definitely just test this one at first. :-)
User avatar
janus
Posts: 407
Joined: Sat Aug 06, 2022 2:05 pm
Has thanked: 684 times
Been thanked: 832 times

Re: NotePad++ Regex

Post by janus »

FritzUser wrote: Wed Jun 21, 2023 10:28 am Maybe something like:

Code: Select all

^\{.*\}$\n\n1.
and replace it with

Code: Select all

1.
The ^ means start of line. The \{ and \} are escaped. $ means end of line, and \n of course is a UNIX newline. If in WIndows, it's \r\n.

Definitely just test this one at first. :-)
Muchas gracias !
Didnt work - NotePad++ said 0 occurrences were replaced.

I tried a few other expressions - none worked unfortunately.
I know there's a regex to do this .. :angry-banghead: :angry-banghead:

EDIT : figured it out finally .. :happy-jumpeveryone:
User avatar
massimilianogoi
Site Admin
Posts: 393
Joined: Thu Aug 04, 2022 1:42 pm
Has thanked: 603 times
Been thanked: 646 times
Contact:

Re: NotePad++ Regex

Post by massimilianogoi »

Quite easy, and I'm pretty sure you can do it even with Notepad: just use the Replace function and replace that sentence with nothing.

I don't use notepad++ but Sublime Text 3, it's a great program for working with texts.

janus wrote: Wed Jun 21, 2023 9:59 am :teasing-signhere: :text-welcomewave:

OK need help here .. I used to be able to do this using NotePad++ but forgot how to do it plus cant find the text file that had the instructions (par for MY course).

[PlyCount "65"]
[TimeControl "240+1"]

{AMD A10-9700 RADEON R7, 10 COMPUTE CORES 4C+6G 3493 MHz W=32.2 plies; 468kN/s;
91 TBAs; OliBiyu_S10_3.ctg B=32.1 plies; 446kN/s; 101 TBAs; OliBiyu_S10_3.ctg}


1. g3 {[%eval 0,0] [%emt 0:00:00]} e5 {[%eval 0,0] [%emt 0:00:00]} 2. c4 {


The above is from Oliprog's PGN file - I want the blue section removed.
I was able to do this quite easily once upon a time.

Any ideas anybody .. please .. :bow-blue:
People who have lost the hope.
User avatar
massimilianogoi
Site Admin
Posts: 393
Joined: Thu Aug 04, 2022 1:42 pm
Has thanked: 603 times
Been thanked: 646 times
Contact:

Re: NotePad++ Regex

Post by massimilianogoi »

Quite easy, and I'm pretty sure you can do it even with Notelad: just use the Replace function and replace that sentence with nothing.

I don't use notepad++ but Sublime Text 3, it's a great program for working with texts.

janus wrote: Wed Jun 21, 2023 9:59 am :teasing-signhere: :text-welcomewave:

OK need help here .. I used to be able to do this using NotePad++ but forgot how to do it plus cant find the text file that had the instructions (par for MY course).

[PlyCount "65"]
[TimeControl "240+1"]

{AMD A10-9700 RADEON R7, 10 COMPUTE CORES 4C+6G 3493 MHz W=32.2 plies; 468kN/s;
91 TBAs; OliBiyu_S10_3.ctg B=32.1 plies; 446kN/s; 101 TBAs; OliBiyu_S10_3.ctg}


1. g3 {[%eval 0,0] [%emt 0:00:00]} e5 {[%eval 0,0] [%emt 0:00:00]} 2. c4 {


The above is from Oliprog's PGN file - I want the blue section removed.
I was able to do this quite easily once upon a time.

Any ideas anybody .. please .. :bow-blue:
People who have lost the hope.
Post Reply