If you are playing with configuration files, a configuration file module will do most of the work and hide a lot of the complexity. Users like to do odd thing such as using whitespace around elements, using different quotes, and other things which the modules can handle and make the regexes unruly:
#!/usr/bin/perl use ConfigReader::Simple; my $file = "/Users/brian/Desktop/config.txt"; my $config = ConfigReader::Simple->new( $file ); print "Has both JRECOV and TEOJ\n" if( $config->get( "JRECOV" ) eq 'yes' && $config->get( "TEOJ" ) eq '-w' );
In reply to Re: multiple regex logical AND
by brian_d_foy
in thread multiple regex logical AND
by bigswifty00000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |