jonschlinkert/time-stamp

regExp

Opened this issue · 2 comments

    var regex = /(?=(YYYY|YY|MM|DD|HH|mm|ss|ms))\1([:\/]*)/;
    What's wrong with using the following?
    var regex=/(?=(YYYY|YY|MM|DD|HH|mm|ss|ms))/;

I can also use the following regular, so I want to ask

Can you clarify the question? I’m not sure I understand. Have you looked at what the regex is doing in the code? Your regex wouldn’t capture the second match group.

I use the regular var regex=/(?=(YYYY|YY|MM|DD|HH|mm|ss|ms))/; already can be normal use, I want to know the following regular
var regex=/(?=(YYYY|YY|MM|DD|HH|mm|ss|ms))/; , is to meet what kind of scene?