javascript - Split JS string via Regex? -


I have MMYY pattern (end of credit card)

me It is necessary to analyze each section (01 and 14): So I tried:

  '0114'.split (/ \ d {2} / i) // ["", "", ""]   

It actually sees 2 digits as a separator and therefore I do not get anything.

However, I have been able to do this with:

  '0114' match (/ \ d {2} / ig) // ["01" "14"]   

But I'm surprised that split .

Can I do also with split ? For example:

  "1234" .split (/ (? = $$$) /) = & gt; A common solution for arbitrary length strings seems impossible, the best we can get is something like this:  
   code> str.split (str.plength and 1? / (? = (?:?) *. $) /: / (? = (??? ::)) + $) /)    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -