Thomas, your regex is fine. It's just that you should use forward slashes to encapsulate your complex regex expression. I understand the docs can be a little confusing. I'll have it updated soon.
/\[.*\]/
Moreover, you don't need to escape brackets to substitute. Here's a sample recipe that you can refer for this.
Dear Sachin,
thank you for your valuable advice. With your help now I was able to code a nice piece of recipe.
PS: I had not dared to make the "find" section like this, because when I entered the code this area was colored red. It then immediately looks "wrong" at first glance. :-D
Send us a ticket, we will try our best to assist you with your problem
Thomas Winkler
How to replace parts of a string wich can be found between [ and ] within a text with .gsub
Hi,
I have a titel of a task e.g. "[Project Alpha 20209] Initial Task" and I'd like to replace the part between [ and ] with a different content.
I tried with
without success. It does not recognize the part between the brackets and does not replace anything at all.
I think there is maybe a problem with the REGEX within the find section. I already tried it in vain with different expressions. Any hints?