I'm trying to match an 8-character word comprising small letters that has the pattern:
Small letters? do you mean small as in low ASCII code or lowercase?
ABCDECFG
Well, /[A-G]{8}/ should yield true.
The only symbol (letter) that is used twice in the word is "C", which is found only in positions 3 and 6.
That is true for the word you presented. Now what? ... guessing ... maybe you want
? that would mach 'corporal' successfully. But then, it has two 'o'. Should that fail then?$c = substr($_,2,1); $pat = "\[^$c\]{2}$c\[^$c\]{2}$c\[^$c\]{2}"; print "yup" if /$pat/
Try again giving us a spec.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: Regex help
by shmem
in thread Regex help
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |