Trey Gruel
I'm trying to implement some data checking using PCRE for regular expressions. My experience using regex is fairly limited and very rusty. For the most part, I've been able to replace most of the simple C based checks with regex, but I'm having trouble with one that I think should be possible with regex.
What I'm having trouble with is a check of an alphanumeric field (up to 10 characters) that lets everything *except* UNK, UNKN, and UNKNOWN through (logic being if it's unknown, it should be blank). I was thinking I should be able to do this with look-ahead or look-behind assertion, but I can't seem to make it work.
Any ideas would be appreciated.
First off, get ahold of a copy of: Mastering Regular Expressions, 2nd Edition By Jeffrey E. F. Friedl 2nd Edition July 2002 ISBN 0-596-00289-0, Order Number: 2890 484 pages, $39.95 US, $61.95 CA, 28.50 UK O'Reilly Secondly, it is almost always a mistake to try to do all your work using a single regex -- use multiple regex's and program logic based on the results.