Re: Preg_match() regex
| From: | Kevin Waterson | Date: | Sat, 22 Apr 2006 08:33:56 +0000 |
| Subject: | Re: Preg_match() regex | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-234547@lists.php.net to get a copy of this message | ||
This one time, at band camp, "Jeff" <jsmforum@optonline.net> wrote:
> Hey all,
>
> Regex pattern question here. I need to match on "Foo-F00", "Foo-foo",
> "foo-Foo". I know in perl you can use the /i to specify "case
> insensitive" matching. Is there any such switch that can be used in
> preg_match() in PHP?
Yes, the same works in PCRE. so you can do
preg_match("/foo-foo/i", $string)
kevin
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."