Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • I didn't test that resulting regex too closely, though Commented Oct 24, 2019 at 16:20
  • Generally, you can't use ranges in EREs for input validation unless you switch to the C locale. [a-z] matches thousands of characters depending on locale or systems and may even match sequences of several characters. For instance, in Hungarian locales on GNU systems, [[ dDZS =~ ^[a-z]$ ]] returns true. As dDZS is a collating element that sorts in between a and z. Commented Feb 24, 2023 at 17:17