Community
    • Login

    wrong sintax

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 257 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Altevir GomesA
      Altevir Gomes
      last edited by PeterJones

      i need help with my sintax, i have already tried this : (?-is).+(?<=|\x20)(.+)(?=\x20-\x20EMAIL:).+
      but not work

      i 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

      Terry RT mkupperM 2 Replies Last reply Reply Quote 1
      • Terry RT
        Terry R @Altevir Gomes
        last edited by Terry R

        @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.

        1 Reply Last reply Reply Quote 2
        • mkupperM
          mkupper @Altevir Gomes
          last edited by

          @Altevir-Gomes said in wrong sintax:

          i need help with my sintax, i have already tried this : (?-is).+(?<=|\x20)(.+)(?=\x20-\x20EMAIL:).+
          but not work

          Try 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 that Aprovada will not match aprovada or other variations in the letter case for both Aprovada and Verificação.
          • ^Aprovada - Starting at the beginning of a line expect the word Aprovada.
          • *\| * - 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 word Verificação followed by a colon :
          • .* match and thus delete everything else on the line.
          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors