in reply to Re: regular expression to check if the textbox contains only special characters
in thread regular expression to check if the textbox contains only special characters
chomp; print /[^A-Z_,]/ ? 'bad' : 'good'
Or, if the format is important, too:
print /^(?:[A-Z_]+,?)+(?<!,)$/ ? 'good' : 'bad';
i.e. at least one uppercase letter or underscore, followed by a comma, this repeating several times, and no trailing comma.
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: regular expression to check if the textbox contains only special characters
by Anonymous Monk on Oct 18, 2016 at 09:54 UTC | |
by choroba (Cardinal) on Oct 18, 2016 at 10:09 UTC | |
by Anonymous Monk on Oct 18, 2016 at 10:15 UTC |