aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOPGSQL.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/EntryDAOPGSQL.php')
-rw-r--r--app/Models/EntryDAOPGSQL.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php
index 6211b9a6b..91068919d 100644
--- a/app/Models/EntryDAOPGSQL.php
+++ b/app/Models/EntryDAOPGSQL.php
@@ -43,6 +43,12 @@ class FreshRSS_EntryDAOPGSQL extends FreshRSS_EntryDAOSQLite {
protected static function sqlRegex(string $expression, string $regex, array &$values): string {
$matches = static::regexToSql($regex);
if (isset($matches['pattern'])) {
+ $replacements = [ // Convert some of the PCRE regex syntax to PostgreSQL
+ '\\b' => '\\y', // matches only at the beginning or end of a word (was: backspace)
+ '\\B' => '\\Y', // matches only at a point that is not the beginning or end of a word (was: backslash)
+ ];
+ $matches['pattern'] = str_replace(array_keys($replacements), array_values($replacements), $matches['pattern']);
+
$matchType = $matches['matchType'] ?? '';
if (str_contains($matchType, 'm')) {
// newline-sensitive matching