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 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-2019 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].