Matches the integer of 1024-65535, that is, 65535 >= x >= 1024. Use regular rules to write it. Mine is
/^(102[4-9]|10[3-9]d {1}|1[1-9]d{2}|[2-9]d{3}|[1-5]d{4}|6[0-4]d{3}|65[0- 4]d{2}|655[0-2]d{1}|6553[0-5])$/
Is there a more concise and optimized way of writing
高洛峰2017-05-19 10:11:54
What's going on? I feel like it's easier to convert this thing into a number and then convert it into a string... I don't know your specific situation
某草草2017-05-19 10:11:54
First subtract 1024 from the number you got and then do the matching. It will be a little simpler d{1,4}|[1-5]d{4}|6[1-3]d{3}|64[1-4]d{2}|6450d|6451[01]
Standing for the answers from all the heroes
我想大声告诉你2017-05-19 10:11:54
/^(6[0-4]d{3}|65[0-4]d{2}|655[0-2]d|6553[0-5]d|[1-5]d{4}|[2-9]d{3}|1d[3-9]d|102[4-9])$/