Validator icon indicating copy to clipboard operation
Validator copied to clipboard

Fix string validator regex rule pipe parsing

Open marshall7m opened this issue 3 years ago • 0 comments

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:arg will parse the rule as is ["regex:foo|invalid_rule:arg"] instead of the expected value of ["regex:foo", "invalid_rule:arg"]

marshall7m avatar Aug 02 '22 06:08 marshall7m