Validator Regular Expression I18 FAQ

Is it possible to use special characters (like german "Umlaute") in an regular expression..

I tried this:

    <constant>
      <constant-name>name</constant-name>
      <constant-value>^[\-\'\`\´\.\ a-zäöüßáéíúóàèìùòâêîôûñA-ZÄÖÜÁÉÍÓÚÀÈÌÒÙÑ]+$</constant-value>
    </constant>

Answer

Samuel Opoku-Boadu answers:

  <global>
     <constant>
        <constant-name>alphanumeric</constant-name>
        <constant-value>^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-]*$</constant-value>
     </constant>
     <constant>
       <constant-name>alphanumericSP</constant-name>
       <constant-value>^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-\ ]*$</constant-value>
     </constant>
  </global>

Up to ValidatorRegularExpressions

  • No labels