I’m going to have a custom tag on my forum, something like
[FISH]data|data|data....[/FISH]
In Jquery, how do I loop through all instances of the [FISH] tag and get all the data between it so I can render? It must:
- Match pairs only (IE, print an error or ignore [FISH] which has no corresponding [/FISH]
- Be case insensitive
You can parse such tags with regular expressions. Try:
Here is a live snippet