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.

Required fields*

3
  • 2
    The above solves alphaAndNumeric, not alphaNumeric. return isNumeric || isAlpha; is alphaNumeric. The above may be helpful to some. Commented Aug 19, 2019 at 15:13
  • 1
    @TamusJRoyce of course. But image to check some VAT number where in some case is just numeric and in other case must be alpha&numeric. By the way, I realize only now, my fault, that the relative PHP function foresees OR instead of AND. Which is a problem because I had to modify all the codes of my PHP applications, creating an ad-hoc function that provided for the AND Commented Feb 18, 2020 at 10:28
  • I feel that a trully alpha&numeric string should be balanced, with 50% of the characters being alpha and the other half being numeric. "qw3rtyuio" can hardly be considered numeric with only a single numeric digit. Commented Jul 14, 2023 at 17:07