boost::regex q'n
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?
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:
^\[.*\]$
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:
^\[(.*)\]$
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement