Drieux wrote:
>
> On Dec 3, 2003, at 12:25 PM, Saskia van der Elst wrote:
>
> > I have trouble executing a search and replace through all files in a
> > certain
> > directory.
> >
> > I want to replace " _</pat" by "</pat"
> >
> > Can I match a white-space?
> >
> > I have tried the following regex:
> >
> > s/ _\</pat/"</pat"/g
> [..]
>
> I agree with Tom that you get better
> mileage by putting your delimiters to
> something OTHER than a token in the
> pattern that you are matching.
>
> but there is also the little detail
> of putting that "\" in the right place.
>
> $_ =~ s/"_\</pat"/"\</pat"/gi; #g for every occurrence, i for
>
> should ahve been
>
> $_ =~ s/_<\/pat/<\/pat/gi; #g for every occurrence, i for
>
> target what you WANT to target and no more.
>
> remember that those double quotes will allow things
> to be 'interpolated' - which is not what you want.

No they won't: they're not string delimiters in this context
so they'll be treated as any other non-special character between
the real s/// slash delimiters.

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to