The regex I have right now is:
string="hello (fdd()()()()(()(())()))"
re.match("%s\s*\((.*?)\)$"%re.escape("hello"), string)
And it will work well, the goal of it is to get whatever is inside the brackets.
In this case: "fdd()()()()(()(())())"
I would like to make an alteration, the regex should work with this test case
"hello (hihihi(((())))hihi) { "
There is a curly-brace at the end of it. There should always be a curly-brace at the end of the given string therefore the first test case that I showed you will not work anymore (with the new regex that I want).
Try looking at it like this
hello[any amount of space]([get WHATEVER is inside here])[any amount of space]{[any amount of space]
I think that using the dollar sign is what is causing me problems. I am obviously not too familiar with using regex, so if anyone can help me that would be great. I am open to any solution including but not limited to other python modules, built in python string features, ect.
Thanks for your help,
$is causing you problems, have you tried removing the$(and the?)??otherwise it ends at the nearest)