View Issue Details

IDProjectCategoryView StatusLast Update
16273Bug reportsConditionspublic2020-08-07 16:50
Reporteraquigar Assigned To 
Status confirmedResolutionopen 
Product Version3.22.15 
Summary16273: Validation regex including unicode characters fails

I´m testing this simple regex to validate the content of an user response:


It matches capital letters, numbers and whitespaces. It seems to be correct and works fine.

But assume I would like to include the unicode char "á".

I've tested the following regexes with no results:





0x00E1 is the hex code value for "á"

Tha validation test fails in all the cases above

Steps To Reproduce

Using a test survey, apply this validation regex to any response field and test...

TagsNo tags attached.
Complete LimeSurvey version number (& build)3.22.15+200505
I will donate to the project if issue is resolvedNo
Database & DB-Versionmysql Ver 15.1 Distrib 10.1.24-MariaDB, for Linux (x86_64) using readline 5.1
Server OS (if known)Red Hat Enterprise Linux Server release 7.3 (Maipo)
Webserver software & version (if known)
PHP Version7.1.5


related to 16531 confirmed Validation regex including unicode characters fails 




2020-05-14 14:30

manager   ~57786

Forum info:



2020-07-21 21:17

developer   ~59028

OK, so what if use decodeHtml or htmlspecialchars_decode for html decoding the "within" parameter in the LEMRegexMatch function.




2020-07-22 17:25

developer   ~59049

@DenisChenu What do you think?



2020-07-22 17:38

developer   ~59050

Are you sure it work ?

My opinion is :
We use preg_match with PHP :
Why we use different option in JS

Why not directly …
And for unicode :

Maybe start by remove gimy modifier …



2020-07-22 17:39

developer   ~59051

PS : still wait a stable 4.X to create some own function (for example : a real word counter …)



2020-07-28 02:28

developer   ~59113

Decoding html before running regex. This (a decode string) is similar to what the PHP side regex function gets.




2020-08-06 14:36

manager   ~59342

Tested the issue before pulling the PR, Issue exist. Tested the issue after pulling the PR, below are my findings:
The Scenario fails in below cases:



Screenshot 1: Includes scenarios where there is no Unicode included and with "á" Unicode
Screenshot 2: Includes scenarios where it works with Unicode "á" but fails for above scenarios

Please refer the attachment for more details

16273_BeforePR.png (202,377 bytes)
16273_AfterPR.png (159,161 bytes)


2020-08-07 16:50

manager   ~59374

Actually the codes mentioned above where wrong , I tried giving as below :


Working as expected

Issue History

Date Modified Username Field Change
2020-05-14 13:19 aquigar New Issue
2020-05-14 14:29 cdorin Priority none => normal
2020-05-14 14:29 cdorin Status new => confirmed
2020-05-14 14:30 cdorin Note Added: 57786
2020-07-21 21:17 gabrieljenik Note Added: 59028
2020-07-22 17:25 gabrieljenik Note Added: 59049
2020-07-22 17:38 DenisChenu Note Added: 59050
2020-07-22 17:39 DenisChenu Note Added: 59051
2020-07-28 02:20 gabrieljenik Issue cloned: 16531
2020-07-28 02:20 gabrieljenik Relationship added related to 16531
2020-07-28 02:28 gabrieljenik Note Added: 59113
2020-08-06 14:36 sushmanadendla Note Added: 59342
2020-08-06 14:36 sushmanadendla File Added: 16273_BeforePR.png
2020-08-06 14:36 sushmanadendla File Added: 16273_AfterPR.png
2020-08-07 16:50 sushmanadendla Note Added: 59374