Re: preg_match
| From: | Richard Lynch | Date: | Sat, 20 Aug 2005 03:20:41 +0000 |
| Subject: | Re: preg_match | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220985@lists.php.net to get a copy of this message | ||
On Fri, August 19, 2005 6:32 am, John Nichel wrote:
> Richard Lynch wrote:
>> On Thu, August 18, 2005 2:50 pm, Jon wrote:
>>
>>>preg_match_all("/Charges \s\s+ $total x (.+) /siU", $single,
>>>$from_invoice);
>>
>>
>> I would recommend using \\s instead of \s -- While \s doesn't have
>> any
>> meaning in PHP strings, so PHP just figures you must have meant \\s
> <snip>
>
> But in perl type regex's, the \s is a space. Without testing it, I
> don't think \\s would match what the OP was looking for (I *think* it
> would match '\s'). However, I don't understand why the OP is looking
> for a space " ", followed by a space "\s", followed by multiple spaces
> "\s+"....a \s{1,} would have done all that just fine.
Actually, if he really needs a minimum of three spaces, as this string
indicates...
"\\s{3,}"
is probably the clearest representation.
Or possibly " {3,}"
--
Like Music?
http://l-i-e.com/artists.htm