javascript - Split JS string via Regex? -
I have me It is necessary to analyze each section (01 and 14): So I tried: It actually sees 2 digits as a separator and therefore I do not get anything. However, I have been able to do this with: But I'm surprised that Can I do also with MMYY pattern (end of credit card)
'0114'.split (/ \ d {2} / i) // ["", "", ""]
'0114' match (/ \ d {2} / ig) // ["01" "14"]
split .
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
Post a Comment