I’m sure this is really simple, but I just can’t figure it out.
I want to extract the URL, target and link from this
Example:
[http://www.testdomain.com/blog/122_Blog Post.aspx _blank]Click here![/]
I have tried this:
\[(.*) (.*)\](.+?)\[\/\]
It works as long as I have _blank or _self following the URL, but if I remove it all together, I get Post.aspx as target (of course).
I also tried things like (_blank)?, but that didn’t work at all.
Please help, RegEx really isn’t my thing, and feel free to suggest other improvements. It doesn’t have to be foolproof, I just want to keep it simple.
Thanks!
Try this: