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

RE: [Clip] Regex Replace

Expand Messages
  • John Shotsky
    This will do as you wish, without regard for any punctuation, parentheses or hyphenation: If those matter, a character class can be used with the /w:
    Message 1 of 6 , May 11, 2010
      This will do as you wish, without regard for any punctuation, parentheses or hyphenation: If those
      matter, a character class can be used with the /w: [\w\(\)\"\(, \.] (Add any other characters you
      may encounter on ends of lines)
      ^!Replace "(\w)\R(\w)" >> "$1\x20$2" ARSTW

      This:
      jhjh jhjh jhjh jhjh
      gg hgh hgh ghg
      mnmn mnmn mnmn mnmn

      jhjh jhjh jhjh jhjh
      gg hgh hgh ghg
      mnmn mnmn mnmn mnmn

      Becomes this:
      jhjh jhjh jhjh jhjh gg hgh hgh ghg mnmn mnmn mnmn mnmn

      jhjh jhjh jhjh jhjh gg hgh hgh ghg mnmn mnmn mnmn mnmn

      Regards,
      John

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of C
      Sent: 11 May, 2010 04:33 AM
      To: ntb-clips@yahoogroups.com
      Subject: [Clip] Regex Replace


      Hi friends,

      I need to replace

      ^Px ---> " x"

      In other words , each new line (^P) followed by any character (x), but not new lines followed by ^p
      or nothing.

      This is because a software create a text (.txt) but with irregular line lenghts, and I want to
      replace all the lines, and later, wordwrap off.

      In other words, the original text is

      jhjh jhjh jhjh jhjh(nl)
      gg hgh hgh ghg(nl)
      mnmn mnmn mnmn mnmn(nl)
      (no characters at this line)

      and must be changed to

      jhjh jhjh jhjh jhjh gg hgh hgh ghg mnmn mnmn mnmn mnmn(nl)

      Naturally, this is a job for a Regex replace, please kindly help

      Brito



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.