• Login
Community
  • Login

regexp search match string inside

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 3 Posters 183 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.
  • P
    patrickdrd
    last edited by patrickdrd Mar 4, 2021, 3:09 PM Mar 4, 2021, 3:08 PM

    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

    A 1 Reply Last reply Mar 4, 2021, 3:59 PM Reply Quote 0
    • A
      Alan Kilborn @patrickdrd
      last edited by Mar 4, 2021, 3:59 PM

      @patrickdrd

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

      1 Reply Last reply Reply Quote 1
      • G
        guy038
        last edited by Mar 4, 2021, 6:25 PM

        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
        2 out of 3
        • First post
          2/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors