\[ doesnt seem to go well within quotes.. Is there a solution here?
You need to do some extra escaping for the opening
str = "i am {name} [age]"; reg = Regex(str, "\!\[\w+\]");
https://www.jmp.com/support/help/en/18.1/jmp/jsl-syntax-rules.shtml
Edit: Some explanation here How do you replace square brackets "[" "]" in a string with Regex? (JMP strings make a special case of \[ and ]\ anywhere in a JMP string to turn off JMP's escaping.)