How can I convert Perl regular expressions to boost regular expressions?

Posted by YY on Stack Overflow See other posts from Stack Overflow or by YY
Published on 2010-03-29T12:29:27Z Indexed on 2010/03/29 13:53 UTC
Read the original article Hit count: 235

Filed under:
|
|
|

I'm not familiar with Perl and boost regular expression and I want to convert a Perl code to c++. I want to convert special regular expression in Perl into c++ using Boost regexp library. Please help me understand what I must do? Here is some regexps that a word of a sentence may match:

if ($word =~ /^[\.:\,()\'\`-]/) { # hack for punctuation
}

if ($word =~ /^[A-Z]/) {
    return;
}

if ($word =~ /[A-Za-z0-9]+\-[A-Za-z0-9]+/) { # all hyphenated words
    return;
}

if ($word =~ /.*[0-9].*/) { # all numbers 
    return;
}

© Stack Overflow or respective owner

Related posts about perl

Related posts about regex