string = myfx("{0}test123", test);
string2 = myfx("actual string");
the lines above are just a couple of 10’s of lines of text in a text file. i iterate the text file and would like to know if there is a single regular expression that will cover the 2 scenarios shown above.
The target strings are “test123” and “actual string”. Is there a way to tell regular expressions not to pull in the “{0}” if it occurs?
To find all text not inside curly brackets, use the regular expression:
Test:
Output:
This method still has limitations. It assumes curly brackets are paired. While with a lot more work it could be made fool-proof, I’m hoping it suits your case.