Difference between revisions of "Mikrotik: Belajar Regex"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 1: | Line 1: | ||
Sumber: https://mikrotik.tips/understanding-regex-mikrotik-routeros/ | Sumber: https://mikrotik.tips/understanding-regex-mikrotik-routeros/ | ||
− | Langkah | + | ==Langkah== |
+ | |||
* Setup tujuan | * Setup tujuan | ||
* Buat matcher | * Buat matcher | ||
* terjemahkan ke regex | * terjemahkan ke regex | ||
− | Contoh | + | ==Contoh== |
+ | |||
* ingin match url yang ada youtube-nya | * ingin match url yang ada youtube-nya | ||
* pattern-nya | * pattern-nya | ||
Line 15: | Line 17: | ||
^.*youtube.*\.com$ | ^.*youtube.*\.com$ | ||
− | Keterangan | + | ==Keterangan== |
− | |||
^ match beginning of the string | ^ match beginning of the string | ||
. match single character | . match single character |
Revision as of 12:46, 3 October 2020
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.xom
- regex-nya adalah
^.+\.youtube\..+$ ^.*youtube.*\.com$
Keterangan
^ match beginning of the string . match single character + * \. untuk mendefinisikan (dot) . bukan (.) $ match end of string