original_string: protected function getJavascriptCallback()
      {
          $regex = $this->getConfig();
  
          if ($pos = strpos($regex, 'u', strrpos($regex, '/'))) {
              $regex = substr($regex, 0, $pos) . substr($regex, $pos + 1);
              $regex = preg_replace('/(?<!\\\\)(?>\\\\\\\\)*\\\\x{([a-fA-F0-9]+)}/', '\\u$1', $regex);
          }
  
          return "function() { var regex = {$regex}; var value = " . $this->owner->getJavascriptValue() .
                 "; return value == '' || regex.test(value); }";
      }
code: protected function getJavascriptCallback()
      {
          $regex = $this->getConfig();
  
          if ($pos = strpos($regex, 'u', strrpos($regex, '/'))) {
              $regex = substr($regex, 0, $pos) . substr($regex, $pos + 1);
              $regex = preg_replace('/(?<!\\\\)(?>\\\\\\\\)*\\\\x{([a-fA-F0-9]+)}/', '\\u$1', $regex);
          }
  
          return "function() { var regex = {$regex}; var value = " . $this->owner->getJavascriptValue() .
                 "; return value == '' || regex.test(value); }";
      }
code_tokens: protected function getJavascriptCallback ( ) { $ regex = $ this -> getConfig ( ) ; if ( $ pos = strpos ( $ regex , 'u' , strrpos ( $ regex , '/' ) ) ) { $ regex = substr ( $ regex , 0 , $ pos ) . substr ( $ regex , $ pos + 1 ) ; $ regex = preg_replace ( '/(?<!\\\\)(?>\\\\\\\\)*\\\\x{([a-fA-F0-9]+)}/' , '\\u$1' , $ regex ) ; } return "function() { var regex = {$regex}; var value = " . $ this -> owner -> getJavascriptValue ( ) . "; return value == '' || regex.test(value); }" ; }
docstring: Returns the client-side validation callback
  
  For this to work properly, slashes have to be used as regex delimiters.
  The method takes care of transforming PHP unicode escapes in regexps to
  JS unicode escapes if using 'u' modifier (see bug #12376)
  
  @return   string
docstring_tokens: Returns the client - side validation callback