• Advertisement
Sign in to follow this  

boost::regex q'n

This topic is 4358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im writting a script file in the format: [something_random_here] { stuff = something else } can i use regex to find the lines
  • where * is a wild card, some string of arbitary length? or is that not the intent of regex library?

    Share this post


    Link to post
    Share on other sites
    Advertisement
    Sure:
    ^\[.*\]$

    You have to escape the [] because they have a special meaning in the regex language. If you also want to capture what's inside the brackets, the expression would be:
    ^\[(.*)\]$

    Share this post


    Link to post
    Share on other sites
    hrmm that doesnt work, i've tried a few variations

    my string is:

    "[pickup]" with out the quotes
    the only thing that expression caught was ""
    :-/

    Share this post


    Link to post
    Share on other sites
    Sign in to follow this  

    • Advertisement