[MDEV-5357] REGEXP word boundaries don't work Created: 2013-11-28  Updated: 2013-12-17  Resolved: 2013-12-17

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.5, 10.0.6
Fix Version/s: 10.0.7

Type: Bug Priority: Major
Reporter: James Sharpe Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None
Environment:

Centos 6.4



 Description   

Since the switch to pcre, word boundary queries such as SELECT 'a word a' REGEXP '[[:<:]]word[[:>:]]'; no longer work because it tries to parse [[:<:]] as a character class name.



 Comments   
Comment by Alexander Barkov [ 2013-11-28 ]

Hi James.

This is a non-standard extension in the old regex library.
We'll think what we can do to provide backward compatibility
for this syntax.

In the meanwhile please use this syntax with PCRE:

SELECT 'a word a' REGEXP '\\bword
b';

Comment by James Sharpe [ 2013-11-30 ]

Does that syntax work in mysql too? The software I'm seeing the issue with is civicrm so I'll push this fix upstream if it works for mysql too.

Comment by Alexander Barkov [ 2013-11-30 ]

Unfortunately, the '\\bword
b' syntax does not work in MySQL. It's a PCRE syntax.

Anyway, we have a good news for you:
This incompatibility will most likely be fixed in the next PCRE release.
Philip Hazel (the PCRE maintainer) kindly argeed to add support
for this non-standard syntax ('[[:<:]]' and '[[:>:]]') into PCRE and
gave us a patch. I'll apply the patch to the PCRE library bundled
with Maria. So the next MariaDB release will also support this syntax again.

Comment by Alexander Barkov [ 2013-12-02 ]

Fixed in 10.0.

Generated at Thu Feb 08 07:03:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.