Page 1 of 1

NotePad++ Regex

Posted: Wed Jun 21, 2023 9:59 am
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:

Re: NotePad++ Regex

Posted: Wed Jun 21, 2023 10:28 am
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. :-)

Re: NotePad++ Regex

Posted: Wed Jun 21, 2023 10:37 am
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:

Re: NotePad++ Regex

Posted: Thu Jun 22, 2023 1:13 am
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:

Re: NotePad++ Regex

Posted: Thu Jun 22, 2023 1:13 am
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: