Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Swap between first found match

by leira (Monk)
on Mar 04, 2004 at 01:34 UTC ( [id://333754]=note: print w/replies, xml ) Need Help??


in reply to Swap between first found match

If you give us a snippet of code to tell us what you've tried, and explain how it didn't work the way you expected, it will be easier for us to understand where you might be stumped.

However, I think you might be looking for something like this:

my $text = "Test of \"this first quote.\" Second quote \"ignored.\""; $text =~ s/\"(.*?)\"/\"that\"/;

Linda

Update: I responded quickly, and could/should have been much clearer. Let's try that again.

my $text = 'Test of "this first quote." Second quote "ignored."'; $text =~ s/"(.*?)"/"that"/;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found