Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RegExp techniques to split
//Split by nothing/position
'USDEUR'.split(/(?=\w{3}$)/); //["USD", "EUR"]
//Split without consuming/swallowing
'2020-10-10'.split(/(-)/); //["2020", "-", "10", "-", "10"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment