Re: [PHP] Re: REGEX for phone #

2002-07-29 Thread Analysis & Solutions

Hi Richard:

On Mon, Jul 29, 2002 at 05:02:49AM -0500, Richard Lynch wrote:
> 
> For starters, if Perl wants \ PHP needs \\ since \ is special in both
> languages.

I'm curiuos what you're talking about.  The manual says nothing about this
in the PCRE section:
   Example 1. Examples of valid patterns
  * <\/\w+>/
  * |(\d{3})-\d+|Sm
http://www.php.net/manual/en/ref.pcre.php

The Pattern Syntax page has a backslashes section which states: In
particular, if you want to match a backslash, you write "\\".

Then, all of my patterns work just fine w/o escaping the backslashes.

So, uh, what are you talking about? :)

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: REGEX for phone #

2002-07-29 Thread Richard Lynch

>I'm using a regular expression (below) to check phone numbers.  I'm getting
>an error that I can't make sense of.
>
>$regex = "^((\(\d{3}(\) -))?*\d{3}(- )\d{4},?*)+$";
>
>Output I'm getting =
>Warning: REG_BADRPT in /home/basemen/public_html/verify_order.php on line 28
>
>Anyone know what this means?  I know it's not bitching about the phone
>number, it's bitching about the expression.  But why?  Some thing wrong with
>the expression?  It works fine in PERL, which this is supposed to be
>compatible with.

For starters, if Perl wants \ PHP needs \\ since \ is special in both
languages.

-- 
Like Music?  http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro).  Need to record live events (mixed already) to stereo
CD-quality.  Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php