diff options
| author | 2024-09-06 09:35:58 +0200 | |
|---|---|---|
| committer | 2024-09-06 09:35:58 +0200 | |
| commit | 1a552bd60eab4a4b940d3896376b599e155d7da0 (patch) | |
| tree | e3872dfc1bc51ed52a88bc22fc7582e858314a71 /docs/en | |
| parent | 35a7634e68d87ad4da46c96ee8066e8c681f8d18 (diff) | |
Regex search (#6706)
* Regex search
fix https://github.com/FreshRSS/FreshRSS/issues/3549
* Fix PHPStan
* Fix escape
* Fix ungreedy
* Initial support for regex search in PostgreSQL and MySQL
* Improvements, support MySQL
* Fix multiline
* Add support for SQLite
* A few tests
* Added author: and inurl: support, documentation
* author example
* Remove \b for now
* Disable regex sanitization for now
* Fix getInurlRegex
* getNotInurlRegex
* Quotes for inurl:
* Fix test
* Fix quoted tags + regex for tags
https://github.com/FreshRSS/FreshRSS/issues/6761
* Fix wrong regex detection
* Add MariaDB
* Fix logic
* Increase requirements for MySQL and MariaDB
Check support for multiline mode in MySQL
* Remove sanitizeRegexes()
* Allow searching HTML code
Allow searching for instance `/<pre>/`
Fix https://github.com/FreshRSS/FreshRSS/issues/6775#issuecomment-2331769883
* Doc regex search HTML
* Fix Doctype
Diffstat (limited to 'docs/en')
| -rw-r--r-- | docs/en/admins/02_Prerequisites.md | 2 | ||||
| -rw-r--r-- | docs/en/admins/DatabaseConfig.md | 2 | ||||
| -rw-r--r-- | docs/en/developers/06_Reporting_Bugs.md | 2 | ||||
| -rw-r--r-- | docs/en/users/10_filter.md | 29 |
4 files changed, 31 insertions, 4 deletions
diff --git a/docs/en/admins/02_Prerequisites.md b/docs/en/admins/02_Prerequisites.md index c54a7fd56..d38093b7a 100644 --- a/docs/en/admins/02_Prerequisites.md +++ b/docs/en/admins/02_Prerequisites.md @@ -9,7 +9,7 @@ You need to verify that your server can run FreshRSS before installing it. If yo | Web server | **Apache 2.4** | nginx, lighttpd<br />minimal compatibility with Apache 2.2 | | PHP | **PHP 8.1+** | FreshRSS 1.21/1.22: PHP 7.2+; FreshRSS 1.23/1.24: PHP 7.4+ | | PHP modules | Required: libxml, cURL, JSON, PDO_MySQL, PCRE and ctype.<br />Required (32-bit only): GMP <br />Recommended: Zlib, mbstring, iconv, ZipArchive<br />*For the whole modules list see [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/edge/Docker/Dockerfile-Alpine#L7-L9)* | | -| Database | **PostgreSQL 10+** | SQLite, MySQL 5.5.3+, MariaDB 5.5+ | +| Database | **PostgreSQL 10+** | SQLite, MariaDB 10.0.5+, MySQL 8.0+ | | Browser | **Firefox** | Chrome, Opera, Safari, or Edge | ## Getting the appropriate version of FreshRSS diff --git a/docs/en/admins/DatabaseConfig.md b/docs/en/admins/DatabaseConfig.md index 575749a7f..bc9b6a175 100644 --- a/docs/en/admins/DatabaseConfig.md +++ b/docs/en/admins/DatabaseConfig.md @@ -1,6 +1,6 @@ # Database configuration -FreshRSS supports the databases SQLite (built-in), PostgreSQL, MySQL / MariaDB. +FreshRSS supports the databases SQLite (built-in), PostgreSQL, MariaDB / MySQL. While the default installation should be fine for most cases, additional tuning can be made. diff --git a/docs/en/developers/06_Reporting_Bugs.md b/docs/en/developers/06_Reporting_Bugs.md index 690330118..0c5d255ff 100644 --- a/docs/en/developers/06_Reporting_Bugs.md +++ b/docs/en/developers/06_Reporting_Bugs.md @@ -64,7 +64,7 @@ Remember to give the following information if you know it: 1. Which browser? Which version? 2. Which server: Apache, Nginx? Which version? 3. Which version of PHP? -4. Which database: SQLite, MySQL, MariaDB, PostgreSQL? Which version? +4. Which database: SQLite, PostgreSQL, MariaDB, MySQL? Which version? 5. Which distribution runs on the server? And… which version? ## How to provide feed data diff --git a/docs/en/users/10_filter.md b/docs/en/users/10_filter.md index 519130c14..943537471 100644 --- a/docs/en/users/10_filter.md +++ b/docs/en/users/10_filter.md @@ -49,7 +49,7 @@ You can use the search field to further refine results: * by author: `author:name` or `author:'composed name'` * by title: `intitle:keyword` or `intitle:'composed keyword'` * by URL: `inurl:keyword` or `inurl:'composed keyword'` -* by tag: `#tag` or `#tag+with+whitespace` +* by tag: `#tag` or `#tag+with+whitespace` or or `#'tag with whitespace'` * by free-text: `keyword` or `'composed keyword'` * by date of discovery, using the [ISO 8601 time interval format](http://en.wikipedia.org/wiki/ISO_8601#Time_intervals): `date:<date-interval>` * From a specific day, or month, or year: @@ -105,6 +105,8 @@ can be used to combine several search criteria with a logical *or* instead: `aut You don’t have to do anything special to combine multiple negative operators. Writing `!intitle:'thing1' !intitle:'thing2'` implies AND, see above. For more pointers on how AND and OR interact with negation, see [this GitHub comment](https://github.com/FreshRSS/FreshRSS/issues/3236#issuecomment-891219460). Additional reading: [De Morgan’s laws](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). +> ℹ️ Searches are applied to the raw HTML content + Finally, parentheses may be used to express more complex queries, with basic negation support: * `(author:Alice OR intitle:hello) (author:Bob OR intitle:world)` @@ -115,6 +117,31 @@ Finally, parentheses may be used to express more complex queries, with basic neg > ℹ️ If you need to search for a parenthesis, it needs to be escaped like `\(` or `\)` +### Regex + +Text searches (including `author:`, `intitle:`, `inurl:`, `#`) may use regular expressions, which must be enclosed in `/ /`. + +Regex searches are case-sensitive by default, but can be made case-insensitive with the `i` modifier like: `/Alice/i` + +Supports multiline mode with `m` modifier like: `/^Alice/m` + +> ℹ️ `author:` is working with one author per line, so the multiline mode may advantageously be used, like: `author:/^Alice Dupont$/im` +> +> ℹ️ `#` is likewise working with one tag per line, so the multiline mode may advantageously be used, like: `#/^Hello World$/im` + +Example to search entries, which title starts with the *Lol* word, with any number of *o*: `intitle:/^Lo+l/i` + +As opposed to normal searches, HTML special characters are not escaped in regex searches, to allow searching HTML code, like: `/Hello <span>world<\/span>/` + +⚠️ Advanced regex syntax details depend on the regex engine used: + +* FreshRSS filter actions such as auto-mark-as-read and auto-favourite use [PHP preg_match](https://php.net/function.preg-match). +* Regex searches depend on which database you are using: + * For SQLite, [PHP preg_match](https://php.net/function.preg-match) is used; + * [For PostgreSQL](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP); + * [For MariaDB](https://mariadb.com/kb/en/pcre/); + * [For MySQL](https://dev.mysql.com/doc/refman/9.0/en/regexp.html#function_regexp-like). + ## By sorting by date You can change the sort order by clicking the toggle button available in the header. |
