Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
None
Description
Dear MariaDB Development Team,
I am writing to request an enhancement to the regular expression functionality in MariaDB, specifically regarding the lack of full support for negative lookahead assertions (such as (?!:)).
In MariaDB 10.11, when attempting to use regular expressions to match patterns that start with : and consist of alphanumeric characters, but do not end with a :, the absence of full support for negative lookahead creates issues.
Problem:
Currently, MariaDB's regular expression engine does not fully support negative lookaheads (e.g., (?!:)), which results in the inability to perform the following task:
Match strings starting with : followed by alphanumeric characters, and
Ensure that these strings do not end with a colon : (i.e., exclude cases like :em25:).
For example, the goal was to remove patterns like:
:4a46b55d976953e6cc9
:abcdef1234567890
But not match strings like:
:em25: something
However, due to the lack of support for negative lookahead in MariaDB's regular expressions, the system erroneously matches both the alphanumeric strings (e.g., :4a46b55d976953e6cc9) and the ones with a trailing colon (e.g., :em25:), causing unintended replacements.
Example:
Original query: The goal is to replace strings like :4a46b55d976953e6cc9 but not :em25:.
Input: :4a46b55d976953e6cc9 more text :em25: something
Expected Output: more text :em25: something
However, due to the limitations, :em25: was also being matched, which is not the intended behavior.
Impact:
This limitation has significant implications when attempting to clean or sanitize text or data that follows such patterns. The inability to use negative lookahead results in faulty replacements or missed matches, affecting the integrity of the intended operation.
Request:
I would like to request that MariaDB enhance its regular expression engine to fully support negative lookahead assertions (such as (?!:)). This would greatly improve the flexibility and correctness of text manipulation operations using regular expressions, especially for use cases where we need to filter out specific patterns or ensure that certain strings do not meet particular conditions (e.g., matching a string that starts with : but does not end with :).
I believe that adding this feature would significantly benefit users who rely on complex regular expressions for text processing within MariaDB.
Thank you for considering this request. I look forward to hearing from you and hope this feature can be added in a future release.
Best regards,