time-stamp icon indicating copy to clipboard operation
time-stamp copied to clipboard

regExp

Open NewPrototype opened this issue 7 years ago • 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

NewPrototype avatar Aug 31 '18 07:08 NewPrototype

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.

jonschlinkert avatar Sep 06 '18 01:09 jonschlinkert

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?

NewPrototype avatar Sep 06 '18 13:09 NewPrototype