Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Replacing parts of a string

by krujos (Curate)
on Apr 11, 2003 at 14:00 UTC ( #249888=note: print w/ replies, xml ) Need Help??


in reply to Replacing parts of a string

If you always have numeric followed by alphabetic in that field how about:
s/(CalandarName=)\d+\w+(&)/$1$ReplacementString$2/
cheers,
Josh
UPDATE: Fixed formatting


Comment on Re: Replacing parts of a string
Download Code
Re: Re: Replacing parts of a string
by diotalevi (Canon) on Apr 11, 2003 at 14:23 UTC

    Just a word - your regex is better written without capturing. s/(?<=CalendarName=)[^&=]*/ReplacementString/. In this case I used a positive assertion so it only begins matching as it hits the end of 'CalendarName=' at which point it replaces everything that isn't an ampersand or an equal character.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://249888]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2015-07-06 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (72 votes), past polls