M
Mike Ballard
I have to search for string pairs such as "Kc Qd" and "Qh Ks" and am
having a problem figuring out a regexp that will exclude (for example):
"Kd Qd"
"Kd Kc"
"Qd Qh"
"Qh Kh"
IOW, both uppercase letters in each pair must be unique (discard "Kx Kx",
"Qx Qx") and the lowercase letters for each pair must be unique (discard
"Ks Qs", "Qc Kc", etc.). The range of lowercase letters is "cdhs".
So if the first part of a pair is "Kh" and the second part is "Kx" or
"Qh", the whole thing needs to be skipped and I move on to the next one.
Can someone tell me how to do this (it's in a perl script btw)?
Mike
--
having a problem figuring out a regexp that will exclude (for example):
"Kd Qd"
"Kd Kc"
"Qd Qh"
"Qh Kh"
IOW, both uppercase letters in each pair must be unique (discard "Kx Kx",
"Qx Qx") and the lowercase letters for each pair must be unique (discard
"Ks Qs", "Qc Kc", etc.). The range of lowercase letters is "cdhs".
So if the first part of a pair is "Kh" and the second part is "Kx" or
"Qh", the whole thing needs to be skipped and I move on to the next one.
Can someone tell me how to do this (it's in a perl script btw)?
Mike
--