You could use this regex:
\[url=(?:'([^']+)'|"([^"]+)")\](.+?)\[\/url\]
It accepts single quote, double quote and no quote delimited url values. The downside is that you have to check multiple capture groups to get the URL attribute value.
Here are the capture groups:
- Group 1: The value found if the attribute is single quote delimited.
- Group 2: The value found if the attribute is double quote delimited.
- Group 3: The text between the URL tags.
If you don't allow square brackets to appear between the URL tags, you could use the following regex instead. It will find a match more quickly in this case.
\[url=(?:'([^']+)'|"([^"]+)")\]([^\[]+)\[\/url\]