Hi Monks,
I am reading lines from a file and getting confused on the quotes and regex stuff!!!!
I want 2a to work. I want to setup some $VALID regex rules up front and then compare them to lines in my file...
$VALID1 = '[-a-zA-Z0-9_.*\s]';
$line1a = "[no\nluck]";
$line1b = "[no\nluck]";
$line2a = '[no\nluck]'; # FROM A read(<FILE>)
$line2b = '[no\nluck]'; # FROM A read(<FILE>)
print "luck1a\n" if $line1a =~ /\[\s*($VALID1+)\s*\]/m;
print "luck1b\n" if $line1b =~ /\[\s*([a-z\s]+)\s*\]/m;
print "luck2a\n" if $line2a =~ /\[\s*($VALID1+)\s*\]/; #DESIRED
print "luck2b\n" if $line2b =~ /\[\s*([a-z\s]+)\s*\]/;