Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Regex help/ Lua parse

by grizzley (Chaplain)
on Oct 26, 2012 at 07:47 UTC ( #1001018=note: print w/replies, xml ) Need Help??


in reply to Regex help/ Lua parse

You could save yourself one match by replacing
if ($line =~ m/^\s*terminal\s=\s"([^"]+)"\s*$/) { $line =~ s/$1/$change/; }
with
$line =~ s/^(\s*terminal\s=\s")([^"]+)("\s*)$/$1$change$3/;

Replies are listed 'Best First'.
Re^2: Regex help/ Lua parse
by marquezc329 (Scribe) on Oct 26, 2012 at 20:53 UTC
    Thank you. Modified all occurrences like this.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001018]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2016-12-11 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (168 votes). Check out past polls.