Boost logo

Boost :

Subject: [boost] [libboost_regex-1_32.dylib] Validating Email address using Regx failing in boost
From: Arun (arun.ka_at_[hidden])
Date: 2009-10-22 07:48:03


Hi All,

I am using boost regex libraries (libboost_regex-1_32.dylib) for
validation of strings. The regular expression string i use is as
below.

string expr = "^((?>[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+\\x20*|\"((?=[\\x01-\\x7f])[^\"\\\\]|\\\\[\\x01-\\x7f])*\"\\x20*)*(?<angle><))?((?!\\.)(?>\\.?[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+)+|\"((?=[\\x01-\\x7f])[^\"\\\\]|\\\\[\\x01-\\x7f])*\")@(((?!-)[a-zA-Z\\d\\-]+(?<!-)\\.)+[a-zA-Z]{2,}|\\[(((?(?<!\\[)\\.)(25[0-5]|2[0-4]\\d|[01]?\\d?\\d)){4}|[a-zA-Z\\d\\-]*[a-zA-Z\\d]:((?=[\\x01-\\x7f])[^\\\\\\[\\]]|\\\\[\\x01-\\x7f])+)\\])(?(angle)>)$";

When i make a call

boost::regex regExpr(expr);

it is throwing what(): Invalid preceding regular expression.

I got the regular expression from
http://regexlib.com/REDetails.aspx?regexp_id=711
 and converted into std::string.

If i print the string onto a terminal, the string exactly matches with
the regular expression
 ^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$

I am not able to find why boost is telling the string as invalid
regular expression.

I work in Mac OS X Leopard, and use boost_1_32.

Any ideas?

Thanks
Arun
Reply
                
Forward
                
                
        
        
New window
Print all
« Back to Sent Mail

Archive

Report spam

Delete

Move to Inbox

Labels

More actions

 1 of 598 Older ›
Use free POP access to download your messages to Outlook or devices
that support POP. Learn more
You are currently using 1306 MB (17%) of your 7382 MB.
Last account activity: 9 minutes ago at this IP (125.16.133.35). Details
Gmail view: standard | turn off chat | older version | basic HTML Learn more
©2009 Google - Terms - Privacy Policy - Google Home


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk