I don’t usually use regular expressions, hence my question. I need a regex to match the following:
'{any-string}'.
Any assistance appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The most simple expression would be:
If you expect more complex strings (for example, some kind of escape sequence where the
{and}characters are allowed within the string) it could be more complex. For instance, with a\(backslash) escape sequence:Edit: That’s not tested, but the general idea is that the expression will swallow any character following the escape rather than ensuring it isn’t the closing brace.