I want to match certain lines inside any text and inside that match, I want to replace a certain character as often, as it occurs. Sample Text:
Any text and "much" "more" of it. Don't replace quotes here
CatchThis( no quotes here, "any more text" , "and so on and so forth...")
catchthat("some other text" , "or less")
some text in "between"
CatchAnything ( "even more" , "and more", no quotes there, "wall of text")
more ("text"""") and quotes after...
Now I want to replace every quote inside the round brackets with, lets say, a hash sign. Desired outcome:
Any text and "much" "more" of it. Don't replace quotes here
CatchThis( no quotes here, #any more text# , #and so on and so forth...#)
catchthat(#some other text# , #or less#)
some text in "between"
CatchAnything ( #even more# , #and more#, no quotes there, #wall of text# )
more ("text"""") and quotes after...
Matching the lines is easy. Here's my pattern for that:
(?i)Catch(?:This|That|Anything)[ \t]*\(.+\)
Unfortunately, I have no idea how to match every quote and replace it...