Difference between revisions of "Mikrotik: Belajar Regex"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) (→Contoh) |
||
Line 12: | Line 12: | ||
* pattern-nya | * pattern-nya | ||
xxx.youtube.xxx | xxx.youtube.xxx | ||
− | xxxyoutubexxx. | + | xxxyoutubexxx.com |
* regex-nya adalah | * regex-nya adalah | ||
^.+\.youtube\..+$ | ^.+\.youtube\..+$ | ||
^.*youtube.*\.com$ | ^.*youtube.*\.com$ | ||
− | + | ||
==Keterangan== | ==Keterangan== | ||
^ match beginning of the string | ^ match beginning of the string |
Latest revision as of 12:47, 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.com
- regex-nya adalah
^.+\.youtube\..+$ ^.*youtube.*\.com$
Keterangan
^ match beginning of the string . match single character + * \. untuk mendefinisikan (dot) . bukan (.) $ match end of string