gui-ying233 / my-bot

Prefer adding u flag in regular expressions JS-0117
Anti-pattern
Minor
3 months agoa year old
Use the 'u' flag with regular expressions
156					"CAT:错误使用标题替换模板的页面",
157					/{{\s*:?\s*(?:Template\s*:|[]\s*:|T\s*:)?\s*(?:[][][]|[][][]).*}}\n?/gis,
158					"",
159					/^Category:需要更换为(?:标题格式化|小写标题)的页面$/160				);
161				// await cleaner(
162				// 	"CAT:错误使用NoSubpage的页面",
Use the 'u' flag with regular expressions
154				);
155				await cleaner(
156					"CAT:错误使用标题替换模板的页面",
157					/{{\s*:?\s*(?:Template\s*:|[]\s*:|T\s*:)?\s*(?:[][][]|[][][]).*}}\n?/gis,158					"",
159					/^Category:需要更换为(?:标题格式化|小写标题)的页面$/
160				);
Use the 'u' flag with regular expressions
145				);
146				await cleaner(
147					"CAT:需要更换为小写标题的页面",
148					/{{\s*:?\s*(?:Template\s*:|[]\s*:|T\s*:)?\s*(?:[][][]|[][][]).*}}\n?/gis,149					"{{小写标题}}"
150				);
151				await cleaner(
Use the 'u' flag with regular expressions
140				);
141				await cleaner(
142					"CAT:需要更换为标题格式化的页面",
143					/{{\s*:?\s*(?:Template\s*:|[]\s*:|T\s*:)?\s*(?:[][][]|[][][]).*}}\n?/gis,144					"{{标题格式化}}"
145				);
146				await cleaner(
Use the 'u' flag with regular expressions
136			await bot.login().then(async () => {
137				await cleaner(
138					"CAT:错误使用标题格式化的页面",
139					/{{\s*:?\s*(?:Template\s*:|[模样樣]板\s*:|T\s*:)?\s*[标標][题題]格式化.*}}\n?/gi140				);
141				await cleaner(
142					"CAT:需要更换为标题格式化的页面",