in reply to Regexp for alphabetical order match within the string
#!/usr/bin/perl -w use strict; if ($ARGV[0] !~ /(.).*(??{"[^$1-z]"})/ix) { print "alpha\n"; } else { print "non-alpha\n"; } __END__ [sgifford@sglaptop sgifford]$ perl /tmp/t4 abcxz alpha [sgifford@sglaptop sgifford]$ perl /tmp/t4 abcda non-alpha [sgifford@sglaptop sgifford]$ perl /tmp/t4 aaaaaaab alpha [sgifford@sglaptop sgifford]$ perl /tmp/t4 aaaaaaabcccccccz alpha [sgifford@sglaptop sgifford]$ perl /tmp/t4 aaaaaaabcccccdccz non-alpha [sgifford@sglaptop sgifford]$ perl /tmp/t4 aaaaaaaaaaaaa alpha [sgifford@sglaptop sgifford]$ perl /tmp/t4 abcdefghijklmnopqrstuvwxyz alpha
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regexp for alphbetical order match within the string
by Roy Johnson (Monsignor) on Oct 30, 2003 at 21:09 UTC | |
by BrowserUk (Patriarch) on Oct 30, 2003 at 22:33 UTC | |
by Roy Johnson (Monsignor) on Oct 31, 2003 at 14:47 UTC | |
|
Re: Re: Regexp for alphabetical order match within the string
by Nkuvu (Priest) on Oct 30, 2003 at 20:21 UTC | |
by sgifford (Prior) on Oct 30, 2003 at 20:43 UTC | |
by Nkuvu (Priest) on Oct 30, 2003 at 22:01 UTC |