Community
    • Login

    regexp search match string inside

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 375 Views 1 Watching
    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.
    • patrickdrdP Offline
      patrickdrd
      last edited by patrickdrd

      hello,
      I’ve got this search regexp:

      SRcv: ACKώΜ ΛΚΤΒ.*ΒΕ.*\*00
      

      and I would like to match the text that is between “BE” and “*00”

      for example in the string:

      SRcv: ACKώΜ ΛΚΤΒ100540ΛΚΤΒ101938145503101028Ξ001Β10ΒΕ63076179590000000000100000000001000000000010000101000000173610004752183ΚΒΩΒΡΤΒΓΗΓΤΖΓΤ      ΒΒΕΤΖΤΧΛ ΚΥΒ.                           %%ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΧΥΒΕΡΒΒΡΤΒΓΕ ΗΒΒ.   ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΝΒΡΒΖΒΩΗΓΕ ΗΒΒΒΡΤΥΡΛΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΗΒΒΒΡΤΥΡΛΕ ΧΥΒ.     101002101149702ΚΒΩΒΡΤΒΓΗΓΤΖΓΤ      ΒΒΕΤΖΤΧΛ ΚΥΒ.                           %%ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΧΥΒΕΡΒΒΡΤΒΓΕ ΗΒΒ.   ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΝΒΡΒΖΒΩΗΓΕ ΗΒΒΒΡΤΥΡΛΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΗΒΒΒΡΤΥΡΛΕ ΧΥΒ.     01000000000010112300%000000010090721135000000000011578865202103030000000000000000000000000000000000000000000000000000000000004903990000000101123000000142442510000000000101123003ΑGCF%021%%*(52272020600000000010000000000874000015Χ20210303000474000016Π20210303000873000010Π20210303000473000010Χ20210303000890059990Χ20210303000490059990Π202103030200000000010112300004880999990Χ20210303004880000175Π20210303*02950001500000001011230095010013*050109802098050980609808098*00
      

      to match (i.e. return in search results):

      ΒΕ63076179590000000000100000000001000000000010000101000000173610004752183ΚΒΩΒΡΤΒΓΗΓΤΖΓΤ      ΒΒΕΤΖΤΧΛ ΚΥΒ.                           %%ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΧΥΒΕΡΒΒΡΤΒΓΕ ΗΒΒ.   ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΝΒΡΒΖΒΩΗΓΕ ΗΒΒΒΡΤΥΡΛΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΗΒΒΒΡΤΥΡΛΕ ΧΥΒ.     101002101149702ΚΒΩΒΡΤΒΓΗΓΤΖΓΤ      ΒΒΕΤΖΤΧΛ ΚΥΒ.                           %%ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΧΥΒΕΡΒΒΡΤΒΓΕ ΗΒΒ.   ΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΝΒΡΒΖΒΩΗΓΕ ΗΒΒΒΡΤΥΡΛΚΒΩΒΡΤΒΓΗΓΤΖΓΕ      ΗΒΒΒΡΤΥΡΛΕ ΧΥΒ.     01000000000010112300%000000010090721135000000000011578865202103030000000000000000000000000000000000000000000000000000000000004903990000000101123000000142442510000000000101123003ΑGCF%021%%*(52272020600000000010000000000874000015Χ20210303000474000016Π20210303000873000010Π20210303000473000010Χ20210303000890059990Χ20210303000490059990Π202103030200000000010112300004880999990Χ20210303004880000175Π20210303*02950001500000001011230095010013*050109802098050980609808098*00
      

      thanks

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @patrickdrd
        last edited by

        @patrickdrd

        Maybe try making your first .* into .*? to match a minimum amount, rather than a maximum amount?

        1 Reply Last reply Reply Quote 1
        • guy038G Offline
          guy038
          last edited by

          Hi, @patrickdrd, @alan-kilborn and All

          • To select from the last string ΒΕ of the lines ( Greek letters ! ) till the string *00, use the regex (?-s).+\KΒΕ.+\*00

          • To select from the first string ΒΕ of the lines ( Greek letters ! ) till the string *00, use the regex (?-s).+?\KΒΕ.+\*00

          Note that, if the string *00 ends each line of your file, you can simplify these regexes as, respectively, (?-s).+\KΒΕ.+ and (?-s).+?\KΒΕ.+

          Best Regards,

          guy038

          1 Reply Last reply Reply Quote 2

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors