I can currently using:
$results.find('a[href$=".doc"]')
to find anything ending with .doc for editing reasons. However, this seems to be case sensitive, i.e. if a document ends with .DOC or .Doc, it will not find those. Is it possible to make this non case sensitive?
You have to create a function to match case insensitively.
$results.find('a').filter(function(){return /\.doc$/i.test(this.href);});
It is also possible to enumerate all 8 cases in the selector, but this won't scale easily.
$results.find('a[href$=".doc"],a[href$=".doC"],a[href$=".dOc"],a[href$=".dOC"],a[href$=".Doc"],a[href$=".DoC"],a[href$=".DOc"],a[href$=".DOC"]')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With