从Regex(Zotero)到ENG\s+;狗和英语狗还是英语狗匹配?
表达式需要换行符和空格,但它们不能出现<代码>0空格可能性从Regex(Zotero)到ENG\s+;狗和英语狗还是英语狗匹配?,regex,space,Regex,Space,表达式需要换行符和空格,但它们不能出现0空格可能性 ENG\s+狗需要匹配: ENG DOGS ENGDOGS ENG [line break] DOGS 您需要改用*量词 ENG\s*DOGS 正则表达式: ENG # 'ENG' \s* # whitespace (\n, \r, \t, \f, and " ") (0 or more times) DOGS # 'DOGS' 可以识别以下量词 * Match
ENG\s+狗
需要匹配:
ENG DOGS
ENGDOGS
ENG [line break]
DOGS
您需要改用
*
量词
ENG\s*DOGS
正则表达式:
ENG # 'ENG'
\s* # whitespace (\n, \r, \t, \f, and " ") (0 or more times)
DOGS # 'DOGS'
可以识别以下量词
* Match 0 or more times
+ Match 1 or more times
? Match 1 or 0 times
{n} Match exactly n times
{n,} Match at least n times
{n,m} Match at least n but not more than m times
这可以做到:
/ENG\s*DOGS/
Match the characters “ENG” literally «ENG»
Match a single character that is a “whitespace character” (spaces, tabs, and line breaks) «\s*»
Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
Match the characters “DOGS” literally «DOGS»
那么狗和狗是平等的?