in reply to Re^2: regular expression to check if the textbox contains only special characters
in thread regular expression to check if the textbox contains only special characters
Hi I tried your suggestion as below
while (<DATA>) { if (/^(?:[A-Z_]+,?)+(?<!,)$/) {print "good";} else {print "bad";} print; }
__DATA__ * *,* *.* ABC ABC* *ABC ABC_TO ABC_TO,DEF,GHI_JKL,GHI_JK1_TO
Good string format are ABC,ABC_TO and ABC_TO,DEF,GHI_JKL,GHI_JK1_TO but somehow I am getting this as BAD ABC_TO,DEF,GHI_JKL,GHI_JK1_TO
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: regular expression to check if the textbox contains only special characters
by choroba (Cardinal) on Oct 18, 2016 at 10:09 UTC | |
|
Re^4: regular expression to check if the textbox contains only special characters
by Anonymous Monk on Oct 18, 2016 at 10:15 UTC |