Is it possible to do such kind of replacement with regular expression (doesn’t matter what kind of regex language reference tho)?
Original:
Blabla caseInsensitiveKnownFixedWord[thisRandomWordMustRemainUntouched] more blabla
Replaced:
Blabla myNewWord(thisRandomWordMustRemainUntouched) more blabla
Shorter:
a[b] replaced with c(b)
a is known, b is random unknown single word
It would be great if it takes in mind also white spaces before and after "[" and "]"
Sure, just replace
a\[([^\]]*)\]withc(\1).For example, you see it working in PHP on ideone.com.