I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.
I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?
EDIT: The attribute filters allow you to select based on patterns of an attribute value.
If you just want to select elements that contain given string then you can use following selector:
$(':contains("search string")')
I'm just giving my real time example:
In native javascript I used following snippet to find the elements with ids starts with "select2-qownerName_select-result".
document.querySelectorAll("[id^='select2-qownerName_select-result']");
When we shifted from javascript to jQuery we've replaced above snippet with the following which involves less code changes without disturbing the logic.
$("[id^='select2-qownerName_select-result']")
If your use of regular expression is limited to test if an attribut start with a certain string, you can use the ^ jquery selector
For example if your want to only select div with id starting with "abc", you can use
$("div[id^='abc']")
A lot of very useful selectors to avoid use of regex can be find here : http://api.jquery.com/category/selectors/attribute-selectors/
Here you go!