Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    selecting text using find with regular expression

    Help wanted · · · – – – · · ·
    2
    3
    2080
    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.
    • Zs L
      Zs L last edited by

      Hello!
      I would like to select only part of the found text. The regular expression is: <tag data=“([^”]+)" />, it finds & selects the text correctly, but it selects the entire match not only the submatch (…). How can i do this?
      Thanks

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        Claudia Frank @Zs L last edited by

        Hello Zs-L,

        not sure what your final goal is but maybe this is one does it.

        (?=.*)([^"]+)(?=" />)
        

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Zs L
          Zs L last edited by

          Thank you very much! I have to use the assertions in the regular expression as you did.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors