Foxtrek_64 Posted January 11 Share Posted January 11 (edited) I have a database field which accepts FontAwesome icon classes. It's a text field with the following regex: ^(fa(-[0-9a-zA-Z]+)+)( (fa(-[0-9a-zA-Z]+)+)+)*$ Plugging this regex string into regexr, it properly validates my chosen FontAwesome declaration: fa-solid fa-balance-scale-right fa-4x If the regexr link dies, the only custom setting is that I've configured it to be PCRE validation. However, when attempting to create a new record, it fails the regex operation. What is causing this validation to fail? Edited January 11 by Foxtrek_64 Add details about regexr config Link to comment Share on other sites More sharing options...
Jim M Posted January 11 Share Posted January 11 PHP 7.4+ uses PCRE2 validation. Have you tried scaling back the value which you are inserting? Does the validation work with just "fa-solid"? Link to comment Share on other sites More sharing options...
Foxtrek_64 Posted January 11 Author Share Posted January 11 3 minutes ago, Jim M said: PHP 7.4+ uses PCRE2 validation. Have you tried scaling back the value which you are inserting? Does the validation work with just "fa-solid"? I've tried with just fa-solid. It does not pass validation. Link to comment Share on other sites More sharing options...
Jim M Posted January 11 Share Posted January 11 Please be advised I have tagged a developer to this topic for further review. Foxtrek_64 1 Link to comment Share on other sites More sharing options...
Solution Ryan Ashbrook Posted January 11 Solution Share Posted January 11 You are missing your beginning and end delimiters. Try this: /^(fa(-[0-9a-zA-Z]+)+)( (fa(-[0-9a-zA-Z]+)+)+)*$/i And then set Apply text formatter to Yes, and then set Formatting Option to All lower-case in case someone enters a valid Font Awesome icon class, but uppercase. Link to comment Share on other sites More sharing options...
Foxtrek_64 Posted January 11 Author Share Posted January 11 Thanks Ryan! That seems to have resolved the issue. Link to comment Share on other sites More sharing options...
Recommended Posts