I found (?!regex) on that same site, but on this page
http://www.regular-expressions.info/refadv.html
Zero-width negative lookahead. The overall match will only succeed if the
regex inside the lookahead fails to match.
I've given up and created 2 records one with the CAN selection and one
without.
Matt Hopkins
Sr. Programmer/Analyst
Web: www.pdpgroupinc.com
Email: MWHopkins@xxxxxxxxxxxxxxx
Office: 410-584-0330
Fax: 410-584-0336
Cell: 410-258-8845
From: "Dennis Lovelady" <iseries@xxxxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'"
<midrange-l@xxxxxxxxxxxx>
Date: 04/15/2010 01:00 PM
Subject: RE: Regular expression not valid on i
Sent by: midrange-l-bounces@xxxxxxxxxxxx
RE: ^.*?CREDI(T ?)?L(I|Y)(NX|NK|NKS)((?!CAN|\bca\b).)*$
The (T ?)? is saying that I could have a 'T', or a 'T ' or neither
(CREDIT
LINKS, CREDILINKS, CREDITLINKS) and all that works well. The LINKS
could
be spelled LINKS, LYNKS, LINK, LYNK, LINX, LYNX.
Yes, that much makes sense after dropping the initial 4.
The last group '((?!CAN|\bCA\b).)*$' is supposed to say if after the
CREDI... there is CAN anywhere or CA in a word, then the expression is
not
valid. As I said the expression works in a REGEX validation program I
have
on the PC, but when I put the same expression on the i5, it fails with
the
message I listed. If I remove the '((?!CAN|\bCA\b).)*$' then the
expression compiles.
I didn't understand your (?! Syntax so I tried to look it up at
http://www.regular-expressions.info/brackets.html. I do not find
reference
to your syntax, so not sure how it's supposed to work. I found (?: and
(?>
(only the first of which was familiar to me).
Interestingly, when you compile the expression without specifying
REG_EXTENDED, it compiles (at V5R3). But it still doesn't seem to match
as
you'd hoped. If you feel strongly that this is a bug, I would suggest
taking it up with your service provider and see how IBM responds.
Personally, I am unfamiliar with the PC program with which you have done
your test, and cannot vouch for its validity either.
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"A conference is a gathering of important people who singly can do nothing
but together can decide that nothing can be done."
-- Fred Allen
As an Amazon Associate we earn from qualifying purchases.