$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Problem with regular expression's validity and matching
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-23 22:52:33
AMDG
Paulino De Assis Fong wrote:
>> std::wstring 
>> csRegex(L"((\(\d{3}\)?)|(\d{3}))([\s-./]?)(\d{3})([\s-./]?)(\d{4})")
>>     
>
> Hi Steve,
>
> I didn't hardcode the value like the example you pointed out. I read the value 
> from a CDATA section in an xml document so the value should be probably 
> escaped and stored in csRegex, which is a CString. Thanks
>   
Ok.  The problem is [\s-./].  '-' is a special character inside [].
This is true for perl as well:
C:\boost\trunk>perl
my $x = "test-test";
$x =~ s/[t-e]{3}/x/;
Invalid [] range "t-e" in regex; marked by <-- HERE in m/[t-e <-- HERE 
]{3}/ at
- line 2.
In Christ,
Steven Watanabe