I have a string like:
[a b=\"c\" d=\"e\"]Some multi line text[/a]
Now the part d=\"e\"
is optional. I want to convert such type of
Would some multiline text
include [
and ]
? If not, you can just replace [
with <
and ]
with >
using string.replace - no need of regex.
Update:
If it can be anything but [/a]
, you can replace
^\[a([^\]]+)](.*?)\[/a]$
with
$2
I haven't escaped ]
and /
in the regex - escape them if necessary to get
^\[a([^\]]+)\](.*?)\[\/a\]$