Re: Regular expression problem
From: Chris Dutton (rubyguru_at_hotmail.com)
Date: 07/23/04
- Next message: Nathan Zumwalt: "Re: How to search a website for perticluar information??/"
- Previous message: Paul L: "SAX Locator linenumber off when blank lines in XML"
- In reply to: Joe Ray: "Regular expression problem"
- Next in thread: Raymond DeCampo: "Re: Regular expression problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 23 Jul 2004 00:33:40 GMT
Joe Ray wrote:
> I am trying to come up with a regular expression that searches and
> replaces all occurences of the string "'" and replaces it with "''" .
> However if a backslash comes before the single quote I do NOT want it
> too be replaced with two single quotes. Any clues?
A zero-width look-ahead assertion should be able to do what you need.
(?<=[^\\]|.{0})'
- Next message: Nathan Zumwalt: "Re: How to search a website for perticluar information??/"
- Previous message: Paul L: "SAX Locator linenumber off when blank lines in XML"
- In reply to: Joe Ray: "Regular expression problem"
- Next in thread: Raymond DeCampo: "Re: Regular expression problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|