I want to get the value of the background attribute (background.jpg) inside square bracket like BBCode editor's and I tried this regexp
\[(\w+)[^\]]*](.*?)\[\/\1]/g
but it didn't work.
[code background="background.jpg"] Here some text [/code]
I want to get the value of the background attribute (background.jpg) inside square bracket like BBCode editor's and I tried this regexp
\[(\w+)[^\]]*](.*?)\[\/\1]/g
but it didn't work.
[code background="background.jpg"] Here some text [/code]
Use the below regex and get the value of
background
attribute from group index 2.DEMO