需求1:
匹配 <My cat is brown>中的cat, 不匹配<category or bobcat>中的cat
Tcl:
\ycat\y
Python:
\bcat\b
需求2:
匹配<staccato>中的cat
Tcl:
\Ycat\Y
Python:
\Bcat\B
需求3:
匹配<staccato, category and bobcat>中cat, 不匹配<My cat is brown>中cat
Tcl
\Ycat|cat\Y
Python:
\Bcat|cat\B