錢幣符號會找出結尾與符號前方鄰接字元一致的字串。
舉例來說,end$ 將與下列字串達成比對:
- Temporarily suspend
- We’re going off the deep end
- Match the characters that prepend
不過,end$ 無法與下列字串達成比對:
- Temporarily suspend.
- We’re going off the deep end.
- Match the characters that prepend.
以上 3 行的結尾均為「nd.」,而非此規則運算式所要比對的「end」字元。
請使用這類規則運算式,建立用來比對 URI 的區隔、篩選器或目標步驟。舉例來說,如果您要測試新舊版 .htm 網頁的成效有何差異,就可以使用類似下方的規則運算式來識別各個版本:
- email-signup\.htm$
- email-signup\.html$
請使用反斜線字元 (\) 來逸出圓點 (.) 字元,以確保系統照字面解讀該字元。