[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [curn-users] how to escape forward slash in regExp?
- To: Brian Clapper <bmc@xxxxxxxxxxx>, curn-users@xxxxxxxxxxx
- Subject: Re: [curn-users] how to escape forward slash in regExp?
- From: Mark Fletcher <dafletcha@xxxxxxxxx>
- Date: Mon, 9 Oct 2006 10:00:56 -0700 (PDT)
- Authentication-results: wildbean.clapper.org from=dafletcha@xxxxxxxxx; sender-id=neutral; spf=neutral
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=t/BQFCXF3656eF4nCssD/UVw5BgP5xykFbQq0FgTi92JUlFnk3oe4BcI8z8n0GQMLHOdlN1J2pnLrCTSqzL45WqlzNZKno4lklUgnRPMpIZP6nE8wPxJ//RiKVtWJHNwp8G6ZzmWaDBN8yFmKh91/vh8NXGWZmlBLZ7CZl4NVjE= ;
- In-reply-to: <452A7E7F.8090604@xxxxxxxxxxx>
- Sender: owner-curn-users@xxxxxxxxxxx
Beautiful! That solved it.
Thank you.
--- Brian Clapper <bmc@xxxxxxxxxxx> wrote:
> On 10/09/06 12:43, Mark Fletcher wrote:
> > Hi Brian,
> >
> > I'm trying to use EditFeedURL and I need to use forward slashes in
> my
> > replacement string. I'm trying to do something like this:
> >
> > 's/&/\/IssueNavigator/'
> >
> > (append "/IssueNavigator" to existing url)
> >
> > but the parser keeps interpreting the first escaped forward slash
> as
> > the end of the replacement string and then gives an error about an
> > "unknown modifier 'I'. Am I wrong in thinking that a backslash
> should
> > be used to escape reserved characters?
>
> That's a "bug" (or, more correctly, a "lack of feature") in the
> substitution parser; it doesn't honor escapes.
>
> But, regardless, a better, more readable solution is to use a
> different
> delimiter, something other than "/". For example:
>
> 's|$|/IssueNavigator|'
>
> Note, too, that you want to use a "$", not an "&", to denote "end of
> line"
> in the regular expression.
> --
> -Brian
>
> Brian Clapper, http://www.clapper.org/bmc/
> Wagner's music is better than it sounds.
> -- Mark Twain
> ---
> *** Posted to the curn-users mailing list (curn-users@xxxxxxxxxxx).
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---
*** Posted to the curn-users mailing list (curn-users@xxxxxxxxxxx).
Back to curn-users archive.