I would like to filter results in Isotope by matching only beginning of line strings. I know regexp should be something along the lines of [/^\b($string)/igm] http://regexr.com/3e9gc but I can't seem to make it work.
Here is Isotope's own codepen example on which I have tried to apply this regexp:
qsRegex = new RegExp( "\\b("+$quicksearch.val()+")", 'gmi' );
What's happening is it's using $this.text() to get all text within each element box, then running the regex on that. That text includes all sorts of spaces and such, so you have to be more flexible to get it to work correctly.
Plutonium Pu 94 (244)
\s* after the line-start allows any number of whitespace characters to appear next, before the word itself.
qsRegex = new RegExp( "^\\s*\\b("+$quicksearch.val()+")", 'gmi' );