I am attempting to use regular expressions to pull out something similar to the below string. However, there will be multiple with different functions within the data-plugin
attribute.
<div class="plugin" data-plugin="function(1,2,'func')"></div>
I was using an expression like the following:
/<div class="js-plugin" data-plugin="([a-zA-Z0-9\(\),\' ]*)"></div>/
However, this can't work as the string like 'func'
could include all sorts of special characters.
How can I use a regular expression to pull out the entire string, and match the contents within data-plugin=""
as well as presuming there may be multiple matches.