wrong sintax
-
i need help with my sintax, i have already tried this : (?-is).+(?<=|\x20)(.+)(?=\x20-\x20EMAIL:).+
but not worki have this:
Aprovada | denize.bastos@bol.com.br | marinabe | Verificação: Sim! | IP Info: http://ip-api.com/json/ | By: CubeTechnology.org Aprovada | dianabarretto@bol.com.br | 1983lp | Verificação: Sim! | IP Info: http://ip-api.com/json/ | By: CubeTechnology.org Aprovada | utilarutilidades@bol.com.br | 120422stp | Verificação: Sim! | IP Info: http://ip-api.com/json/ | By: CubeTechnology.org Aprovada | edmar.b.muniz@bol.com.br | baixista | Verificação: Sim! | IP Info: http://ip-api.com/json/ | By: CubeTechnology.org Aprovada | elastol@bol.com.br | 261815 | Verificação: Sim! | IP Info: http://ip-api.com/json/ | By: CubeTechnology.org Aprovada | elisabel.moreto@bol.com.br | debeda03 | Verificação: Sim! | IP Info: http://ip-api.com/json/ | By: CubeTechnology.org
i want this:
gifavero@bol.com.br|anjinho laferrazmotta@bol.com.br|motta123 rosan.magda@bol.com.br|sayd331 kradis@bol.com.br|123qwe ns.lira@bol.com.br|lira2903 sol-ribeiro2012@bol.com.br|71c71c71 oliveira-mt2011@bol.com.br|mar3280
please someone can help me fixing this sintax
—
moderator added code markdown around text; please don’t forget to use the
</>
button to mark example text as “code” so that characters don’t get changed by the forum -
@Altevir-Gomes said in wrong sintax:
please someone can help me fixing this sintax
Your before examples do not correspond with the after processing result. There is also a FAQ post where you are requested to provide examples within a code block so data isn’t altered in posting. Read the FAQ post called “Template for Search/Replace Questions”.
However it does appear that you want the 2nd and 3rd fields without first and last spaces (delimiter is the
|
character). If so then the following regular expression should work.Find What:
(?-s)^[^|]+\|\x20+(.+?)\x20+\|\x20+(.+?)\x20+\|.+
Replace With:${1}|${2}
If this isn’t working repeat your examples, this time posting in the code block, and use the correct results to correspond with the examples. I see the moderator has helped by inserting examples in the code block.
Terry
PS not sure where you got the regular expression you tried but it was never going to work. Did AI provide it? You have to careful as they often don’t give good results.
-
@Altevir-Gomes said in wrong sintax:
i need help with my sintax, i have already tried this : (?-is).+(?<=|\x20)(.+)(?=\x20-\x20EMAIL:).+
but not workTry this:
Search:(?-i)^Aprovada *\| *([^ |]*) *\| *([^ |]*) *\| *Verificação:.*
Replace:\1\|\2
Reading from left to right the search part does:
(?-i)
- Make this a case sensitive search so thatAprovada
will not matchaprovada
or other variations in the letter case for bothAprovada
andVerificação
.^Aprovada
- Starting at the beginning of a line expect the wordAprovada
.*\| *
- Match zero or more spaces followed by a|
followed by zero or more spaces.([^ |]*)
- This is the first capture group and will be the e-mail address. It scans/skips over everything that is not a space or|
. I used*
to allow the e-mail field to be empty.*\| *
- Match zero or more spaces followed by a|
followed by zero or more spaces.([^ |]*)
- This is the second capture group and is the name field. It too can be empty.*\| *
- Match zero or more spaces followed by a|
followed by zero or more spaces.Verificação:
- Expect the wordVerificação
followed by a colon:
.*
match and thus delete everything else on the line.