× 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.



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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.