mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-03-13 00:18:13 -04:00
✨ Feature(custom): add u flag for gallery regexp match
This commit is contained in:
parent
0476346070
commit
aa9e535fd1
@ -182,7 +182,7 @@ export const svg = `
|
||||
export function customStrMatch (str: string, pattern: string) : boolean {
|
||||
if (!str || !pattern) return false
|
||||
try {
|
||||
const reg = new RegExp(pattern, 'g')
|
||||
const reg = new RegExp(pattern, 'ug')
|
||||
return reg.test(str)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
@ -195,7 +195,7 @@ export function customStrReplace (str: string, pattern: string, replacement: str
|
||||
replacement = replacement || ''
|
||||
let result = str
|
||||
try {
|
||||
const reg = new RegExp(pattern, 'g')
|
||||
const reg = new RegExp(pattern, 'ug')
|
||||
result = str.replace(reg, replacement)
|
||||
result = renameFileNameWithCustomString(result, result, str)
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user