Mikrotik: Belajar Regex: Difference between revisions
From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs) Created page with "Sumber: https://mikrotik.tips/understanding-regex-mikrotik-routeros/ ==Referensi== * https://mikrotik.tips/understanding-regex-mikrotik-routeros/" |
Onnowpurbo (talk | contribs) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Sumber: https://mikrotik.tips/understanding-regex-mikrotik-routeros/ | 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 | |||
Latest revision as of 05: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