What does this expression return?
'2024-01-15'.match(/[^-]+/g)
- ['2024', '01', '15']
- ['2024', '-01', '-15']
- ['2024-01-15']
- ['2', '0', '1']
A leading
Play Regex ▸
^ inside brackets negates the class, so [^-]+ matches runs of non-hyphen characters.