dcts
dcts

Reputation: 1639

MariaDB: REGEX with [.character.] doesnt work anymore ('POSIX collating elements are not supported)

I have an error that is driving me crazy. When I take the following MySQL REGEX example from the official MySQL page i get an error. Used SQL-Statement:

SELECT '~' REGEXP '[[.tilde.]]';

Error message I get:

#1139 - Got error 'POSIX collating elements are not supported at offset 1' from regexp

Source of the example (scroll down to [.characters.]): https://dev.mysql.com/doc/refman/5.7/en/regexp.html#operator_regexp

Upvotes: 3

Views: 974

Answers (1)

chakmear
chakmear

Reputation: 111

By the answers above I came to the answer to my similar error... "POSIX named classes are supported only within a class" Changed my DjangoDB from Postgresql to Mysql/MariaDB and had an error because of a special search pattern in my Django App:

search_pattern = r'(-|[:space:]|/|[(]|[)])*%s' return Q(telefon__iregex=search) | Q(mobil__iregex=search)

I replaced it by...

search_pattern = r'(-| |/|[(]|[)])*%s' return Q(telefon__iregex=search) | Q(mobil__iregex=search)

fixed it. Thus MariaDB really seems to not like the []-expressions... Thanks for the hints!

Upvotes: 1

Related Questions