DEV Community

Discussion on: Javascript lookaheads and lookbehinds

Collapse
 
qm3ster profile image
Mihail Malo

My favorite is that this zero-length capturing regex finally works in JS now:

'WowSoNiceSQLPotatoes'.split(/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/)
[ 'Wow', 'So', 'Nice', 'SQL', 'Potatoes' ]