Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
そのため、プレフィックスで始まり、a続いていないbものをブロックするように、ホワイトリストに何かを追加したいと考えています。
a
b
例:
a.b.blah -> Good a.c.blah -> Bad, should be blocked
その特定の正規表現を書く方法がわかりません。ポインタはありますか?
文字列 があるとし"a b"ます。使用できます/a(?= *b)/。(?= )一致の一部として返されないように、スペースが含まれていることに注意してください。それが続くかどうかがわかります。
"a b"
/a(?= *b)/
(?= )
追従させたくない場合は、 を使用します/a(?! *b)/。
/a(?! *b)/