Mailinglist Archive: opensuse-programming (68 mails)

< Previous Next >
Tips for PCRE expressions?
  • From: Trey Gruel <drathos-suse@xxxxxxxxxxxxxx>
  • Date: Wed, 7 Jan 2004 14:35:35 -0500 (EST)
  • Message-id: <Pine.LNX.4.44.0401071416440.4771-100000@xxxxxxxxxxxxxxxxxxxxx>

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.

--
trey



< Previous Next >
Follow Ups