Skip to main content
  1. Tags/

阿里巴巴

2017

阿里面试算法题(转载)

·9433 words·19 mins
I want to match those five numbers 3, 7, 8, 9, 87 through regular express. Here is my thought: match those four numbers 3 7 8 9 var ^[3|7|8|9]\( match number 87 var ^87\) Then combine them together, (^[3|7|8|9]\(|^87\)). With some test, it seems correct. Is there any way to do that more efficiently?