picomatch icon indicating copy to clipboard operation
picomatch copied to clipboard

The actual result of toRegex dosen't match the document,missing symbol ^$

Open EAGzzyCSL opened this issue 1 year ago • 0 comments

document example

link: toRegex

const picomatch = require('picomatch');
// picomatch.toRegex(source[, options]);

const { output } = picomatch.parse('*.js');
console.log(picomatch.toRegex(output));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/

actual result

image

missing symbol ^ & $ and with other differences

- /^(?:(?!\.)(?=.)[^/]*?\.js)$/
+ /(?!\.)(?=.)[^/]*?\.js/

version

both v3 and v4

EAGzzyCSL avatar Mar 06 '24 12:03 EAGzzyCSL