Loading ...
Sorry, an error occurred while loading the content.

regular expressions - how to delete everything but found content?

Expand Messages
  • Don
    I am looking to extract every instance of this from a long document: d+
    Message 1 of 2 , Dec 7, 2010
    • 0 Attachment
      I am looking to extract every instance of this from a long document:
      \>\d+\<

      how would I go about doing this?
    • Axel Berger
      ... ^!Replace (?s) d+ d+
      Message 2 of 2 , Dec 7, 2010
      • 0 Attachment
        Don wrote:
        > I am looking to extract every instance of this from a long document:
        > \>\d+\<

        ^!Replace "(?s)\>\d+\<(.+?)\>\d+\<" >> "" WRASTI

        Do that at least twice because the first run misses every second
        occurrence. (Diodeom would suggest a far more elegant solution for this,
        I'll continue being a primitivist.)
        Plus some extra for the beginning and the end of your file.

        Axel
      Your message has been successfully submitted and would be delivered to recipients shortly.