On Friday 16 July 2004 20:21, Rory McKinley wrote:

> I am currently trying to check for the absence of certain substrings
> within larger strings using
> regular expressions. I know that I could use on of the string functions,
> but in the interests of
> flexibility I must use a regexp match of some shape or variety. Up until
> now, 

Could you explain why you need flexibility? 

> An example of my problem:
>
> I need to check that the substring " R" (that's a space followed by an
> uppercase R) is not contained within my haystack.

A simple strpos() would suffice.

> E.g. Whatever pattern I match, if I match it against the following
> haystacks:
>
> "Blah Blah R 99.99" or  "Blah Blah R99.99" it should return negative
> (i.e. the substring is contained within the haystack)
>
> while
>
> "Blah Blah 99.99CR" should return positive (i.e. the substring is not
> within the haystack).

TRUE/FALSE can easily be reversed using !.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
All of a sudden, I want to THROW OVER my promising ACTING CAREER, grow
a LONG BLACK BEARD and wear a BASEBALL HAT!! ...  Although I don't know WHY!!
*/

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

Reply via email to