Moode Forum
[IDEA] Add support for regular expressions (via =~ and !~) in Library Advanced Search - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: [IDEA] Add support for regular expressions (via =~ and !~) in Library Advanced Search (/showthread.php?tid=5764)



Add support for regular expressions (via =~ and !~) in Library Advanced Search - jenzd - 09-07-2023

Moode 8.3.6 introduced support for the comparison operators == and != for all the fields of the Library Advanced Search. Thanks for this update which greatly improves the flexibility of the search function.

Idea: Flexibility could be taken even further by additionally adding support for the comparison operators =~ and !~ which enable pattern matching via regular expressions (https://en.wikipedia.org/wiki/Regular_expression#Basic_concepts). Note that the syntax is actually the same as for == and !=, so the implementation should in principle be straightforward (see https://mpd.readthedocs.io/en/latest/protocol.html#filters).

Thanks & best regards
Jens


RE: Add support for regular expressions (via =~ and !~) in Library Advanced Search - Tim Curtis - 09-07-2023

Sure no prob. I'll add that for the final end-of-year release (Q4).
Btw, PERL regex is already used for the 'lossy' and 'lossless' predefined filters. See inc/music-library.php