Community
    • Login

    How to copy or extract particular string value from each line ?

    Scheduled Pinned Locked Moved General Discussion
    10 Posts 7 Posters 1.0k 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.
    • ply2nitewP
      ply2nitew
      last edited by

      3,11042,‘+xxxxx’,‘xxxxxx’,‘yel2449@gmail.com’,‘aaa’,‘bbbb’,‘{": }’,‘xxx’,‘709 xxx’‘xxx ‘,‘xx’,‘yyyyy’1,‘date’,value,digits’date time’,‘date time’,‘date now time now’,‘cccc’,‘date time’,’$2b$10$fTjK7idPKvtWvySpHXNrkuKA4Z1xBHj1CCyWb479wa226auA.9edq’,
      10’+1xxx’,‘vvvvvv’,‘cccc’,‘ccccc’,‘dick@give.com’,‘aaa’,‘bbbb’,‘{": 0, }’,‘xxx’,‘1911 xxx’,‘’,“xxxx’,‘xx’,‘xxx’,‘xxx+a8zHoy2+xxx/xxx+xx/xxx/s5+9/xxxx=‘1,‘xxx’,xxx,xxx’xxx’,‘xxx’,‘cccc’‘cc’’,‘xx-5w8:ccc-xx’,1,ccc,‘$2b$10$CdArUFezWXGz7MFErEoF/el4Mjk9DuI7rvODQGSZdM.XsK7PzyXBm’,‘USR-dae8-4449-a20d-’
      12,10691,‘+xxxxx’,‘zzzzzzzzz’‘jan@outlook.com’,‘aaa’,‘bbbb’,'{”: null, : 40, }‘,‘xxx’,‘3511 Dxxx’‘xxx’,‘xx’,‘xxxxx’11.00,34741’9999-12-31 23:59:59’,‘xxx’,‘xxx’,‘59348f6e9506294f0eeee46b’,‘xx’,’$2b$10$eIpf.KQGn/sYdj4icMYFFOQrH7PVB5n4vtHglRBfETyoR1KjEg5WG’,
      21,9968,‘+zzzzzzz’,‘zzzzzzzzzzz’‘bh5@gmail.com’,‘aaaa’,‘bbbb’,‘{": null,}’,‘xxx’,‘194 xxxx’s sss’‘xxx’,‘xx’,‘xxxx’,‘zzz/7anw+xxx/cccc/xxx’1,‘xxx’,1.00,xxxx’xxxx’,‘xxxx’,‘zzzz’‘zzzz’‘xx:ccccc’,1,vvvv,‘$2b$10$di2ILbz4863ZyxdrXQwBSeShJiysv7KDS/geIHHOV8j42O4VTCkQu’,

      How can to extract or bookmart 2 part i make bold in this document, if format as regex, that is email and a work start with special char $
      please me help
      Thanks all

      Terry RT Lycan ThropeL 2 Replies Last reply Reply Quote 0
      • Terry RT
        Terry R @ply2nitew
        last edited by

        @ply2nitew
        How about reading the post at the start of this group called “Please Read this before Posting”. And then repost your example as stipulated in the link in that post called “Template for Search/Replace Questions” which is in the FAQ section.

        In your example either the posting engine has reworked some of your quotes or your data appears to be badly formed.

        Sometimes the text you want is preceded by a ’ and others have a ‘.

        It certainly is possible to create a regex to help you but unless you can show correct data we are probably just wasting our time.

        Terry

        1 Reply Last reply Reply Quote 0
        • Lycan ThropeL
          Lycan Thrope @ply2nitew
          last edited by

          @ply2nitew ,
          I agree with @Terry-R that you do need to read the FAQ’s.
          That said, if the data that you typed, is not malformed or screwed up, plus all you’re asking is how to find that text for bookmarking, then the following regex should do the job, but only if you are not moving the goal posts. Since I sense that English isn’t your native language, still you should convert and read the FAQ’s for this forum for any further requests.

          \$2b\$10\$.*

          1 Reply Last reply Reply Quote 0
          • CoisesC
            Coises
            last edited by Coises

            If I’m following you, you want to end up with a file that looks like this:

            yel2449@gmail.com  $2b$10$fTjK7idPKvtWvySpHXNrkuKA4Z1xBHj1CCyWb479wa226auA.9edq
            dick@give.com      $2b$10$CdArUFezWXGz7MFErEoF/el4Mjk9DuI7rvODQGSZdM.XsK7PzyXBm
            jan@outlook.com    $2b$10$eIpf.KQGn/sYdj4icMYFFOQrH7PVB5n4vtHglRBfETyoR1KjEg5WG
            bh5@gmail.com      $2b$10$di2ILbz4863ZyxdrXQwBSeShJiysv7KDS/geIHHOV8j42O4VTCkQu
            

            Is that correct?

            I think this:

            Find what: ^.*?([\w\.]*@[\w\.]*).*(\$[^‘’“”'"]*).*$
            Replace with: \1\t\2
            

            will give you what you need.

            Probably there was some mangling in what you pasted, and you don’t really have a mix of curly and straight single and double quotes; if they’re all straight quotes in the file, you don’t need the curlies in the expression.

            Alan KilbornA Paul WormerP 2 Replies Last reply Reply Quote 2
            • Alan KilbornA
              Alan Kilborn @Coises
              last edited by

              @Coises

              How does one obtain italics in a “code block” on this site?:

              8342d30f-8474-4f1f-8ecd-c201bd955db6-image.png

              PeterJonesP 1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @Alan Kilborn
                last edited by

                @Alan-Kilborn ,

                I’m sure it wasn’t anything @Coises did intentionally. I believe it’s the difference between:

                ```
                Find what: ^.*?([\w\.]*@[\w\.]*).*(\$[^‘’“”'"]*).*$
                Replace with: \1\t\2
                ```
                

                rendering as

                Find what: ^.*?([\w\.]*@[\w\.]*).*(\$[^‘’“”'"]*).*$
                Replace with: \1\t\2
                

                (with italics)

                and

                ```txt
                Find what: ^.*?([\w\.]*@[\w\.]*).*(\$[^‘’“”'"]*).*$
                Replace with: \1\t\2
                ```
                

                rendering as

                Find what: ^.*?([\w\.]*@[\w\.]*).*(\$[^‘’“”'"]*).*$
                Replace with: \1\t\2
                

                (without italics)

                That is, something about the contents text block triggered one of the forum’s code-block lexers (though I don’t know which one).

                Alan KilbornA 1 Reply Last reply Reply Quote 2
                • Alan KilbornA
                  Alan Kilborn @PeterJones
                  last edited by

                  The difference in Peter’s two ``` sections is that the second one adds txt to its start.

                  @PeterJones said:

                  something about the contents text block triggered one of the forum’s code-block lexers

                  At least it is only lexing that changes, and not content. The first thing I think when I see italics in a regular expression is that at least 2 * have been mistaken as formatting, and consumed.

                  I haven’t encountered this before. I suppose the best advice is to always specify ```txt if that is what you intend.

                  1 Reply Last reply Reply Quote 2
                  • Paul WormerP
                    Paul Wormer @Coises
                    last edited by

                    @Coises said in How to copy or extract particular string value from each line ?:

                    ^.*?([\w\.]*@[\w\.]*).*(\$[^‘’“”'"]*).*$
                    

                    This regex doesn’t do it for me. I need the second arbchar also lazy:

                    ^.*?([\w\.]*@[\w\.]*).*?(\$[^‘’“”'"]*).*$
                    

                    This is so for both Npp and the regex module of Python.

                    CoisesC 1 Reply Last reply Reply Quote 0
                    • CoisesC
                      Coises @Paul Wormer
                      last edited by

                      @Paul-Wormer said in How to copy or extract particular string value from each line ?:

                      @Coises said in How to copy or extract particular string value from each line ?:

                      ^.*?([\w\.]*@[\w\.]*).*(\$[^‘’“”'"]*).*$
                      

                      This regex doesn’t do it for me. I need the second arbchar also lazy:

                      ^.*?([\w\.]*@[\w\.]*).*?(\$[^‘’“”'"]*).*$
                      

                      This is so for both Npp and the regex module of Python.

                      Sounds like you have . matches newline checked, and I don’t. Good observation, since no one said it had to be unchecked.

                      PeterJonesP 1 Reply Last reply Reply Quote 0
                      • PeterJonesP
                        PeterJones @Coises
                        last edited by

                        @Coises said in How to copy or extract particular string value from each line ?:

                        Good observation, since no one said it had to be unchecked

                        That’s why Alan and I try to always prefix our regex that use . with (?-s) or (?s) (depending) to make sure that option is in the right state, regardless of the checkbox state.

                        1 Reply Last reply Reply Quote 2
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors