or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
正規表達式
Regular Expression
為什麼要學?
超方便!
未來一定會用到的字串處理技能
推薦學習資源
RegexOne
Let's GO!
練習
(建議至 RegexOne 上練習效果更佳)
以下提供幾種範例解,供讀者快速理解用。
Match abcdefg
Match abcde
Match abc
Ans: "[a-z]+"、"\w+"
Match abc123xyz
Match var g = 123;
Match define "123"
Ans: "[a-z0-9 =";]+"、"[\w" =;]+"
Match cat.
Match 896.
Match ?=+.
Skip abc1
Ans: "...\."
Match can
Match man
Match fan
Skip dan
Skip ran
Skip pan
Ans: "[cmf]an"、"[^drp]an"
Match wazzzzzup
Match wazzzup
Skip wazup
Ans: "waz{2,}up"、"waz{3,5}up"
Match aaaabcc
Match aabbbbc
Match aacc
Skip a
Ans: "a{2,4}b{0,4}c{1,2}"、"aa+b*c+"
Match 1 file found?
Match 2 files found?
Match 24 files found?
Skip No files found.
Ans: "\d+ files? found\?"
Match Mission: successful
Skip Last Mission: unsuccessful
Skip Next Mission: successful upon capture of target
Ans: "^Mission: successful$"
Match I love cats
Match I love dogs
Skip I love logs
Skip I love cogs
Ans: "I love (cats|dogs)"