範例
Highlighted characters form the query in order; intervening characters stay visible.
Find UploadButton using its initials
輸入
src/UploadButton.tsxExpected answer
src/<span class="hl1"><b>U</b>pload<b>B</b></span>utton.tsx- 搜索
ub- 连续匹配加分
15- 分隔符匹配加分
30- 驼峰匹配加分
30- 首字母匹配加分
15- 前导字母惩罚
-5- 最大前导字母惩罚
-15- 未匹配字母惩罚
-1
Jump to npm audit with a sparse abbreviation
輸入
npm auditExpected answer
<span class="hl1"><b>n</b>pm <b>a</b>u<b>d</b></span>it- 搜索
nad- 连续匹配加分
15- 分隔符匹配加分
30- 驼峰匹配加分
30- 首字母匹配加分
15- 前导字母惩罚
-5- 最大前导字母惩罚
-15- 未匹配字母惩罚
-1
Find an RFC file without typing its number
輸入
rfc9110.htmlExpected answer
<span class="hl1"><b>rfc</b>9110.<b>html</b></span>- 搜索
rfchtml- 连续匹配加分
15- 分隔符匹配加分
30- 驼峰匹配加分
30- 首字母匹配加分
15- 前导字母惩罚
-5- 最大前导字母惩罚
-15- 未匹配字母惩罚
-1
Match a snake_case field by its initials
輸入
first_nameExpected answer
<span class="hl1"><b>f</b>irst_<b>n</b></span>ame- 搜索
fn- 连续匹配加分
15- 分隔符匹配加分
30- 驼峰匹配加分
30- 首字母匹配加分
15- 前导字母惩罚
-5- 最大前导字母惩罚
-15- 未匹配字母惩罚
-1
Reject a search whose letters are absent
輸入
caféExpected answer
No matches.- 搜索
xyz- 连续匹配加分
15- 分隔符匹配加分
30- 驼峰匹配加分
30- 首字母匹配加分
15- 前导字母惩罚
-5- 最大前导字母惩罚
-15- 未匹配字母惩罚
-1
参數
| 参數 | 默認值 | 輸入與選項 |
|---|---|---|
| 搜索 | "" | 支持 \n、\r 和 \t 等跳脫序列 |
| 连续匹配加分 | 15 | 相邻字元匹配时增加的分數。 |
| 分隔符匹配加分 | 30 | 匹配出現在分隔符之後时增加的分數。 |
| 驼峰匹配加分 | 30 | 匹配大寫字母、且前一个字元為小寫时增加的分數。 |
| 首字母匹配加分 | 15 | 首字元匹配时增加的分數。 |
| 前导字母惩罚 | -5 | 首次匹配之前,每个字元扣除的分數。 |
| 最大前导字母惩罚 | -15 | 首次匹配之前的字元累計最多扣除的分數。 |
| 未匹配字母惩罚 | -1 | 數字 |