Interestingly, this works .{0,10}
But this gives an error .{0,11}
-----Original Message-----
From: Hiebert, Chris [mailto:chris.hiebert@xxxxxxxxxxxxxx]
Sent: Thursday, August 01, 2019 2:46 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Regex, look-behind & unbounded
Have you tried to just put bounds on the expression?
For example ".*" becomes ".{0,1000}"
And ".+" becomes ".{1,1000}"
Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Justin Taylor
Sent: Thursday, July 25, 2019 6:59 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Regex, look-behind & unbounded
Regular expressions have this restriction:
"The length of possible strings matched by the look-behind pattern must not be unbounded (no * or + operators.)"
(Table 33. Regular Expression Operators, from "IBM i Version 7.3: Database DB2 for i SQL Reference")
I've bumped into this restriction several times recently. So far I've gotten around it by doing the task in multiple steps. Anyone know a neat trick to get look-behind to work with * or + operators?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.