Check out example codes for "regex remove brackets and contents". It will help you in understanding the concepts better.

Code Example 1

/\[.*?\] /g

[A] this is a song [D] [Am] i am [Adim]  Am [f] // input
this is a song i am  Am // output

Learn ReactJs, React Native from akashmittal.com