|
Posted by Alan Little on 05/22/06 21:47
Carved in mystic runes upon the very living rock, the last words of Andy
Jeffries of comp.lang.php make plain:
> On Thu, 18 May 2006 20:56:59 -0500, Alan Little wrote:
>> Carved in mystic runes upon the very living rock, the last words of
>> Andy Jeffries of comp.lang.php make plain:
>>
>>> Yes. The - sign isn't listed in the range (i.e. it would be
>>> [^0-9.\-]) so it will remove it from the output
>>
>> In brackets, you only escape the [] characters themselves. Your
>> expression will allow the \ character in the string.
>
> I appreciate your enthusiasm but did you actually test this before
> trying to correct me ;-)
Yes, I did. However, I checked with ereg(), which does allow the \
character, given the expression you posted earlier.
> However, you do make the good point that you don't *need* to escape
> the -, I just do it for readability so there's no mistaking that I
> meant a literal dash and not part of a range that I forgot to
> complete.
OK. I don't believe it's standard, however.
--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
[Back to original message]
|