Regex validation rule not working

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Regex validation rule not working

Eduardo Olivera
I am using Semantic-UI validation form

  <script type="text/javascript" th:inline="javascript"> /*<![CDATA[*/ var formSettings = { on: 'submit', inline: true, transition: 'fade down', fields: { capital: { identifier: 'capital', rules: [{ type: 'regExp[/^[A-Z]{1,5}$/]', prompt: [[#{form.validation.empty.message}]] }] } } }; /*]]>*/ </script>

Regular expression regExp[/[A-Z]{1,5}$/] then Thymeleaf Ok

regExp[/^[A-Z]{1,5}$/] Not Working

Caused by: org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "
     /*
<![CDATA[*/    
     
     
    [...]
     
     /*]]>
*/

HOW TO ESCAPE ^?