Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Regex random values pattern match and code efficiency

by Mark.Allan (Sexton)
on Sep 12, 2013 at 05:50 UTC ( #1053651=note: print w/replies, xml ) Need Help??


in reply to Re: Regex random values pattern match and code efficiency
in thread Regex random values pattern match and code efficiency

Thanks for that advice, just an update to the first question which critically I missed off, I need only the values between {} for DEPLOY_PARAMS and not the entire string

  • Comment on Re^2: Regex random values pattern match and code efficiency

Replies are listed 'Best First'.
Re^3: Regex random values pattern match and code efficiency
by Anonymous Monk on Sep 12, 2013 at 14:13 UTC
    just a basic regex loop.. try to adapt this..
    use strict; my $value='$DOMAIN{HOST},$DOMAIN{IP},$DOMAIN{CONFIG}'; my @data = split(',',$value); foreach my $attributes (@data) { $attributes=~ m/(DOMAIN){(.+?)}/; print $2."\n"; }
    prints:
    HOST
    IP
    CONFIG

    kindly perlig
      lol.. why i was logged out?! ^^
      $perlig =~ s/pec/cep/g if 'errors expected';
      this works nicely until I bump into the following value then it crashes

      DEPLOY_PARAMS=$DOMAIN{HOST},$DOMAIN{IP},$DOMAIN{DEVICE,NAME}

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053651]
help
Chatterbox?
[stevieb]: w00t! my i2c module actually works, and it works well!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2017-06-22 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (531 votes). Check out past polls.