Search

Can someone explain how to use case insensitive regexp in datasources filter? Something like this: regexp: {$url-term:.*}/i doesn't work. Thanks!

Firstly, the syntax above is incorrect for using params, try

regexp: ({$url-term}|.*)/i

Although I can't promise this will work, but that would be how to use the param syntax in a regex.

That being said, that would match $url-term or anything or nothing, which is a very odd regex to use.

This works for me...

regexp:{$url-term}

Probably need to describe what I want to do. Maybe this can be solved in some other way.

I do golossary on terms. To simplify the search for the term I want to make ajax-filter for parts of words. To do this, as I understand, I can use regexp or like. However, Symphony does not support 'like'.

I rummaged in the documentation MySQL: MySQL REGEXP is not case sensitive, except when used with binary strings It seems that my problem stems from the fact that I use cyrillic characters. In Latin all right.

I found the solution. Not sure of this approach, but it works. The essence of the solution is to bring the query and retrieve data to a single case (lower).

file: field.input.php, line 220:

$where .= "
    AND (
        lower(t{$field_id}_{$this->_key}.value) {$regex} lower('{$pattern}')
        OR lower(t{$field_id}_{$this->_key}.handle) {$regex} lower('{$pattern}')
    )
";

Any comments are welcome.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details