Incorrect test inputs produced for RegEx word character
See original GitHub issueSpecifying a pattern using a word character (e.g. ^[\w\-.~]+$
) causes invalid generated test inputs such as ŏŏşNÇţā3MKÁŔßïõŜàĆXń²ńÖÞ
.
Replacing the above RegEx with ^[A-Za-z0-9_\-.~]+$
fixes this issue, so I assume that CFN CLI has a bug specifically related to \w
.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Checking input string for the invalid character(s) using regex
Your Regex will encounter an invalid character, then start trying to match again at the next character (which succeeds).
Read more >Everything you need to know about Regular Expressions
After reading this article you will have a solid understanding of what regular expressions are, what they can do, and what they can't...
Read more >Input Validation using Regular Expressions - Security Innovation
Learn how to properly build regular expressions to ensure you're getting the most out of your input validation routines.
Read more >Best Practices for Regular Expressions in .NET - Microsoft Learn
Thoroughly test your regular expression using invalid, near-valid, and valid input. You can use Rex to randomly generate input for a ...
Read more >Regular Expressions :: Eloquent JavaScript
A regular expression consisting of only nonspecial characters simply represents that sequence of characters. If abc occurs anywhere in the string we are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I may also argue that according to JSON Schema docs we shouldn’t be allowing regex patterns that use
\w
According to ECMA 262,
More details: https://docs.python.org/3/library/re.html#re.ASCII https://262.ecma-international.org/5.1/#sec-15.10.2.12 http://json-schema.org/understanding-json-schema/reference/regular_expressions.html