Validator
Validator copied to clipboard
Fix string validator regex rule pipe parsing
Fixes issue #131
- Changes how the translator parses string rules within the _value_to_array() function.
- Uses a special regex pattern for parsing
regex:rules to prevent the regex-related pipes from being detected as separate validator rules. - This approach of not splitting on every pipe
|will cause inaccurate parsings of the rules if the following rule that precedes the regex rule has an invalid name (e.g. rule:regex:foo|invalid_rule:argwill parse the rule as is["regex:foo|invalid_rule:arg"]instead of the expected value of["regex:foo", "invalid_rule:arg"]