On Fri, Feb 07, 2003 at 05:29:49PM +0100, Marian Feiler wrote:
> 
> i have to check if there's a dot in a string, and i need nothing but the
> regex pattern for this... tryed a lot, but the dot itself means to matches
> all.

You can escape the dot either by putting a backslash in front of it or
putting it inside square brackets.  So:

    ereg("a.b","aaabbb");

is true, but

    ereg("a[.]b","aaabbb");

is false.  Other "sensitive" characters can also be escaped in this way;
the bracket expression [][.^$()|*+?-] matches any of those characters.
And to match any *except* those characters, use [^][.^$()|*+?-].

Check the re_format(7) man page for details.  If you don't have a unix
box handy, check http://www.freebsd.org/cgi/man.cgi?query=re_format .

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development                   http://www.it.ca/


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

Reply via email to