Regex: match only letters WITH numbers

前端 未结 4 2234
梦谈多话
梦谈多话 2021-02-13 22:02

How can I create a regex expression that will match only letters with numbers?

I\'ve tried something like (?>[A-z]+)([a-z0-9]+).

4条回答
  •  半阙折子戏
    2021-02-13 22:21

    Don't make it be one regex if you don't have to. Use two regexes that both have to match. In Perl, it would be like this

    if ( /[a-zA-Z]/ && /\d/ ) 
    

提交回复
热议问题