如果客製化的圖片或影片(jpg, png, gif, video)在分享時無法被 Facebook 的發佈預覽。
可以預先做一個 url debugger 讓 Facebook 先 cache 資料。
$.post('https://graph.facebook.com', {
id: URL,
scrape: true
}, function(response) {
});
如果客製化的圖片或影片(jpg, png, gif, video)在分享時無法被 Facebook 的發佈預覽。
可以預先做一個 url debugger 讓 Facebook 先 cache 資料。
$.post('https://graph.facebook.com', {
id: URL,
scrape: true
}, function(response) {
});
信用卡號:測試連結
\d{4}-?\d{4}-?\d{4}-?\d{4}
手機及電話號碼(含分機):測試連結
\d{2,4}-?\d{3,4}-?\d{3,4}#?(\d+)?
Email:測試連結
\([^.][a-z].?[a-z.]+)@(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})
統一發票:測試連結
\^[a-zA-Z]{2}[-]?[0-9]{8}$
工具網站 https://regex101.com/ :可以很快驗證你的正規表達式。
Single-Characters |
|
| \d | 0-9 |
| \w | A-Z, a-z, 0-9 |
| \W | not A-Z, a-z, 0-9 |
| \s | white-space |
| \S | not white-space |
| . | 代表除了換行符號 (\n) 以外的任一字元。如果要包括換行符號, 請使用 [\s\S]。 |
Quantifiers |
|
| * | 0 或 更多 |
| + | 1 或 更多 |
| ? | 0 或 1 |
| {min, max} | 重複 min 到 max 次 |
| {n} | 重複 n 次 |
Position |
|
| ^ | 開始 |
| $ | 結尾 |
| \b | 在邊界的字元 |
Character Class [ ] |
|
| [abc] | 抓單一個字元: a, b, or c |
| - | [-.] 如果 - 是第一個字元,後面的 . 會是實字元 . ,而不是代表任何字元。如果是[a-z]代表 a 到 z。 |
| ^ | [^abc] 代表不是 a,b 或 c。[a^bc] 代表 a 或 b, c |
Alternation ( ) |
|
| (...) | 括住一群字元,將之視成一個集合, 通常用來集合表示多個檢核式。例如 (com|net) |
詳細說明連結:MDN 正規表達式模式的編寫
if( !this.alreadyExecuted ){
this.alreadyExecuted = true;
this.loopTime = 1;
} else {
this.loopTime++;
if( this.loopTime == 2 ){
this.stop();
}
}
| 符號 | 快速鍵 | ||
|---|---|---|---|
| ™ | alt + 2 | ||
| © | alt + G | ||
| ® | alt + R | ||
| ≠ | alt + = | ||
| ÷ | alt + / | ||
| ≤ | alt + , | ||
| ≥ | alt + . | ||
See the Pen Box2d x CSS3 by iAN (@wuthula) on CodePen.