📄 patternmatch.html
字号:
<html>
<head>
</head>
<body vlink="#0000FF" link="#0000FF">
<font size="2" face="Verdana, Times New Roman">
<!-- back to navi start -->
<font size="-2"><-- <a href="navi.html" target="jkp_navi">Navigation</a><br><br>
</font>
<!-- back to navi end -->
<font size="+1"><b>
Pattern matching
</b></font><br><br>
Several parts of this project use pattern matching (e.g. spam-filters and IP-rules). You probably know pattern matching from searching for files. For example when searching for files with the extension 'txt' you will search for '*.mpg'. This text string is a pattern and means "search for all files which begin with any sequence of characters and end with .mpg".<br><br>
I wrote my own small pattern matching module which only accepts three operators. These commands should be sufficient for all purposes in this project though:
<ul>
<li><b>*-operator</b>: stands for any number of characters (including zero).<br><br><i>Example:</i><br>
"he*lo" matches "hello", "hejlo" and "heelo" but also "helo" and "hellllllo"<br><br>
</li>
<li>
<b>?-operator</b>: represents any single character.<br><br><i>Example:</i><br>
"he?lo" matches "hello", "hejlo" and "heelo" but <u>NOT</u> "helo" and "hellllllo"<br><br>
</li>
<li>
<b>[{from}-{to}]-operator</b>: stands for a certain range of characters. This range is delimited by the {from} and {to}. All characters in between belong to this range. Valid ranges are "[0-9]", "[a-z]", "[A-Z]" etc.
<br><br><i>Example:</i><br>
"number[0-9]" matches "number0", "number6" and "number8" but not "numbers" and "number 8"<br><br>
</ul>
<b>Note:</b> As '[' is the beginning of an operator use '[[' in a pattern if you actually mean the character '['.
</font>
<!-- /end-tag replace-->
<!-- \end-tag replace-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -