Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support search using regex #1205

Merged
merged 1 commit into from
Jan 26, 2021
Merged

Support search using regex #1205

merged 1 commit into from
Jan 26, 2021

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Jul 14, 2020

When user searches a term starting and ending with a forward slash, the items will be matched against the regular expression between the slashes.

The syntax of the regular expressions is database-engine specific:


The filtering works but the interface is still incomplete. In particular, the matches will not be highlighted in the articles, and the search regex will be shown split on spaces. Fixed.

Copy link

@phicha20224 phicha20224 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good.

@jtojnar
Copy link
Member Author

jtojnar commented Jan 11, 2021

I want to base this onto #1216, which will make it easier to distinguish the search terms in the UI.

When user searches a term starting and ending with a forward slash,
the items will be matched against the regular expression between the slashes.

The syntax of the regular expressions is database-engine specific:

* MySQL uses POSIX extended https://dev.mysql.com/doc/refman/5.7/en/regexp.html
* PostgreSQL uses POSIX extended with some extensions https://www.sqlite.org/lang_expr.html#the_like_glob_regexp_and_match_operators
* SQLite uses PHP’s PCRE https://www.postgresql.org/docs/12/functions-matching.html#FUNCTIONS-POSIX-REGEXP, https://www.php.net/manual/en/book.pcre.php
@jtojnar jtojnar added this to the 2.19 milestone Jan 26, 2021
@jtojnar jtojnar marked this pull request as ready for review January 26, 2021 13:47
@jtojnar jtojnar merged commit f5049e0 into master Jan 26, 2021
@jtojnar jtojnar deleted the regex-search branch January 26, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants