Home » Java » java – What will be the regx for following expression 123abc,abc43,abc456-123dd,xyz123,…etc-Exceptionshub

java – What will be the regx for following expression 123abc,abc43,abc456-123dd,xyz123,…etc-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

What will be the regx for following expression

123abc,abc43,abc456-123dd,xyz123,…etc

I means the string should be a alphanumeric. It can be a single string or a string with -

  1. 123abc Valid
  2. 123abc-126Xy Valid
  3. Abc345,123-127A Valid
  4. 12sd: Invalid
How to&Answers: