Mikrotik: Belajar Regex

From OnnoWiki
Revision as of 12:47, 3 October 2020 by Onnowpurbo (talk | contribs) (→‎Contoh)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sumber: https://mikrotik.tips/understanding-regex-mikrotik-routeros/

Langkah

  • Setup tujuan
  • Buat matcher
  • terjemahkan ke regex

Contoh

  • ingin match url yang ada youtube-nya
  • pattern-nya
 xxx.youtube.xxx
 xxxyoutubexxx.com
  • regex-nya adalah
^.+\.youtube\..+$
^.*youtube.*\.com$

Keterangan

^  match beginning of the string
.  match single character
+
*
\. untuk mendefinisikan (dot) . bukan (.)
$  match end of string



Referensi