pinokiod 3.19.72 → 3.19.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/index.js +7 -2
- package/package.json +1 -1
package/kernel/index.js
CHANGED
|
@@ -613,8 +613,13 @@ class Kernel {
|
|
|
613
613
|
if (pattern) {
|
|
614
614
|
let match = null
|
|
615
615
|
for(let line of lines) {
|
|
616
|
-
|
|
617
|
-
if (
|
|
616
|
+
let matches = /^\/(.+)\/([dgimsuy]*)$/gs.exec(pattern)
|
|
617
|
+
if (!/g/.test(matches[2])) {
|
|
618
|
+
matches[2] += "g" // if g option is not included, include it (need it for matchAll)
|
|
619
|
+
}
|
|
620
|
+
let re = new RegExp(matches[1], matches[2])
|
|
621
|
+
console.log("testing", { line, pattern, re })
|
|
622
|
+
if (re.test(line)) {
|
|
618
623
|
match = line
|
|
619
624
|
console.log("matched", { line })
|
|
620
625
|
break
|