× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This had occurred to me but didn't fully understand the potential impact. I
should know that Scott never says anything that doesn't have value that
should be understood. I read that Wikipedia article, changed by regular
expression, and it selects the proper rows from my table now.

Thanks, John. Very much appreciated.

Regards,

Tom


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Wednesday, March 28, 2012 8:27 PM
To: Midrange Systems Technical Discussion
Subject: Re: Anybody experienced with regular expressions and UDFs?

On Wed, Mar 28, 2012 at 6:54 PM, Monnier, Gary <Gary.Monnier@xxxxxxxxx>
wrote:
You can also look at
http://www.codeproject.com/Articles/9099/The-30-Minute-Regex-Tutorial
they have a phone number matching pattern of  \b\d{3}-\d{4}.

Theirs  \b\d{3}-\d{4}
Yours   \d{3}-\d{4}

Maybe all you are missing is the \b?

This came up just a couple months ago on the RPG list. What people need to
understand is that there is no single, universal regex language. Just as
Oracle, MS SQL Server, DB2, mySQL, PostgreSQL, etc.
each have their own variants and extensions of the SQL language, each
implementation of regex is potentially a little different.

In particular, not all regex implementations support \d as a shortcut for
digit. According to Scott, the regex being used by the OP should handle
POSIX basic and extended (but *not* Perl-like!) regular expressions. See

http://archive.midrange.com/rpg400-l/201201/msg00171.html

http://en.wikipedia.org/wiki/Regular_Expressions

So you should stick to [0-9] instead. Also note that most modern
implementations of regex are Perl-like, and thus random docs, tutorials, and
testers you find on the Web are likely to be Perl-like as well. You really
have to use the docs that are specifically meant for your exact
implementation of regex.

John
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.