Re: Tough (for me) regex case
From: John Bokma (postmaster_at_castleamber.com)
Date: 04/01/04
- Previous message: MR. UNDERHILL: "PROBLEMS REMOVING AN ASSEMBLY"
- In reply to: Rob Perkins: "Tough (for me) regex case"
- Next in thread: ko: "Re: Tough (for me) regex case"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 31 Mar 2004 20:07:45 -0600
Rob Perkins wrote:
> Hello,
>
> I know I'm not a regular, and I'm new to the arcana of regular
> expressions, so I'm a little stuck with two specific cases and I'm
> hoping for a genius:
>
> The case I'm most stumped on is an input string like this:
>
> The "quick" brown "fox jumped ""over"" the" lazy dog.
>
> Where what I want to have matched is the quoted strings, except that
> paired doublequotes don't count, and I don't want to capture the
> quotemarks. In other words, my desired matches are:
What I do sometimes is:
[1] replace the problem character(s) with something that according to
the specs, can never occur in the string (e.g. s/.../\000/g; with
... the problem char(s), not three dots.
[2] do your thing
[3] undo step 1 (e.g. s/\000/.../g; see remark in step [1] wrt ...)
-- John personal page: http://johnbokma.com/ Freelance Perl / Java developer available - http://castleamber.com/
- Previous message: MR. UNDERHILL: "PROBLEMS REMOVING AN ASSEMBLY"
- In reply to: Rob Perkins: "Tough (for me) regex case"
- Next in thread: ko: "Re: Tough (for me) regex case"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|