Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-06-30 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (388 votes). Check out past polls.