The universe shines on the dragon, 13:00:33 Oh, by the way, create a regular expression. 13:00:46 AM Regular Expression? The universe shines on the dragon, 13:00:58 Only numbers and letters are allowed, and numbers and letters are required. 13:13:21 AM ^ [A-zA-Z0-9] + $ The universe shines on the dragon, 13:17:14 123456 The universe shines on the dragon, 13:17:22 In this way, he is satisfied. The universe shines on the dragon, 13:17:26 Asdfgh The universe shines on the dragon, 13:17:32 He also satisfies 13:17:34 AM Yes 13:17:48 AM So what is not enough? The universe shines on the dragon, 13:17:58 This is not the case. It cannot be all numbers or letters. 13:18:48 AM What's your requirement? The universe shines on the dragon, 13:19:42 Yes 13:29:40 AM ^ ([A-Za-Z] [0-9]) + | ([0-9] [A-Za-Z]) + | ([A-Za-Z] [0-9]) + $ |
-------------------------------------------------------
He must only have numbers and letters, and contain numbers and letters.
I wrote so long:
^ ([A-Za-Z] [0-9]) + | ([0-9] [A-Za-Z]) + | ([A-Za-Z] + [0-9] +) + | ([0-9] + [A-Za-Z] +) + $
or ^ (\ D + [A-Za-Z] + \ D *) | ([A-Za-Z] + \ D + [A-Za-Z] *) $
or ^ ([A-Za-Z] * \ D + [A-Za-Z] +) | ([A-Za-Z] + \ D + [A-Za-Z] *) $
the test is normal, however, I do not know whether there are more concise