---
# System prepended metadata

title: "\U0001F3C5 JS 任務 Day12 - 正規表達式（週末讀物）"
tags: [軟體工程師體驗營 - 2024]

---

---
tags: 軟體工程師體驗營 - 2024
---

# 🏅 JS 任務 Day12 - 正規表達式（週末讀物）


## 體驗營學員補充教學
* [十五分鐘認識正規表達式，解決所有文字難題](https://5xruby.tw/posts/15min-regular-expression)
* [初探Regex 正規表達式](https://moojing.medium.com/javascript-%E5%88%9D%E6%8E%A2regex-%E6%AD%A3%E8%A6%8F%E8%A1%A8%E9%81%94%E5%BC%8F-1da2f4d94795)
* [MDN：正規表達式](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Guide/Regular_Expressions)
* [八道题带你看懂正则表达式！](https://juejin.cn/post/7022823286258008071)
* [深入淺出正則表達式](https://youtu.be/Ex6cCWDwNJU)


### 題目一：手機號碼是否正確
* 是否為 10 碼
* 是不是 09 開頭
``` =JavaScript
// input 輸入
checkPhoneNumber("0955717222")
checkPhoneNumber("331")
checkPhoneNumber("09839398")
checkPhoneNumber("0977121333")
// output 輸出
true
false
false
true
```
### 題目二：訂單編號
超瞎書局的訂單編號規則
* 只有 6 碼
* 開頭必須是 B 開頭
``` =JavaScript
// input 輸入
checkFiveWord("B12")
checkFiveWord("B89212")
checkFiveWord("B8987987")
checkFiveWord("B33212")
checkFiveWord("A33212")
// output 輸出
false
true
false
true
false
```

### 題目三：驗證密碼
來兒美超商的電商密碼規則如下：

1. 至少一個大寫英文
2. 至少一個小寫英文
3. 至少一個數字
4. 至少 8 碼以上

[Google 關鍵字提供](https://www.google.com/search?rlz=1C5CHFA_enTW989TW989&sxsrf=ALiCzsZbd2sNO7QIbGCV88z-zop4MoiDxw:1651826809850&q=%E6%AD%A3%E5%89%87%E8%A1%A8%E9%81%94%E5%BC%8F+%E5%AF%86%E7%A2%BC&sa=X&ved=2ahUKEwiF6eyxvsr3AhVQDN4KHVBSBncQ7xYoAHoECAEQOA&cshid=1651826859140280&biw=1198&bih=755&dpr=1.25)

``` =JavaScript
// input 輸入 
checkPassword("Abc87654")
checkPassword("Av3")
checkPassword("YYYYCC123")
checkPassword("BBBa930033")
checkPassword("Ka78328K")
// output 輸出
true
false
false
true
true

```


## 回報流程

1. 將答案貼在 Codepen 並複製 Codepen 連結貼至「回報區」回報
（也可以將答案直接貼至「回報區」）

![](https://i.imgur.com/vftL5i0.png)


回報區
---

| 報數 |     Discord 名字     |                              Codepen／其他回饋                               |
|:----:|:--------------------:|:----------------------------------------------------------------------------:|
|01|Camila|[Codepen](https://codepen.io/camilalo/pen/ZENzOLm)
|  02  | Andy_12 | [Codepen](https://codepen.io/lifann/pen/qBGBXPq?editors=0011) |
|  03  | Larry | [Codepen](https://codepen.io/larrylinr5/pen/Rwmwxdy?editors=0012) |
|  04  | jerry | [Codepen](https://codepen.io/sony791210/pen/OJYJzdB) |
|  05  | 詹姆士 | [Codepen](https://codepen.io/z111048/pen/GRaRQRY?editors=0011) |
|  06  | tim | [Codepen](https://codepen.io/jskrtivy-the-animator/pen/Jjqjpdy?editors=1112) |
|  07  | Aya | [Codepen](https://codepen.io/NoNameNote/pen/eYaYZmd) |
|08|Michelle0417|[Codepen](https://codepen.io/michelle0417/pen/mdYdXVz)|
|  09  | yuan! | [Codepen](https://codepen.io/townyuan/pen/JjqjpeB) |
|  10  | 白白 | [Codepen](https://codepen.io/YuBai/pen/KKLKZYP?editors=0011) |
|  11  | Chia Pin | [Codepen](https://codepen.io/joker-cat/pen/OJYJvpR) |
|  12  | yunyouob | [Codepen](https://codepen.io/ozkkvlsu-the-animator/pen/NWVWYvg?editors=1111)|
|  13  | Tanyaaaa | [Codepen](https://codepen.io/tanya77777/pen/RwmwRzp) |
|  14  | JUN_ | [Codepen](https://codepen.io/Jun-L/pen/wvbvjwp?editors=1011) |
|  15  | Daphne | [Codepen](https://codepen.io/DaphneShen/pen/ZENEoLd?editors=1111) |
|  16  | JY | [Codepen](https://codepen.io/jylee0805/pen/JjqjvOK)| 
|  17  | kawa | [Codepen](https://codepen.io/z83xji6/pen/pomoKxR?editors=0011) |
|  18  | s870012 | [Codepen](https://codepen.io/idzrvbnl-the-bashful/pen/LYoYBRv?editors=0011) |
|  19  | Jiahe | [Codepen](https://codepen.io/Andywang-95/pen/QWRWBwd?editors=0012) |
|  20  | KUN. | [Codepen](https://codepen.io/barry91205/pen/PovoxmN?editors=1111) |
|  21  | leo.chang | [Codepen](https://codepen.io/s16777216/pen/GRaRwXj) |
|  22  | Tough life | [Codepen](https://codepen.io/hakuei0115/pen/Baeaboj) |
|  23  | Mionne | [Codepen](https://codepen.io/neohyntw/pen/mdYydVb) |
| 24 | maru3096 | [Codepen](https://codepen.io/deamru/pen/rNgaamX) |
| 25 | ycyc_324 | [Codepen](https://codepen.io/YC-the-vuer/pen/RwmNPNy?editors=0010) |
|  26  | oldan | [Codepen](https://codepen.io/Enix-Chien-/pen/wvbBWzG) |
|  27  | Ariel | [Codepen](https://codepen.io/ariel0510/pen/GRagmBe?editors=0011) |
|  28  | easonpan | [Codepen](https://codepen.io/easonpan0904/pen/pomoZEW) |
|  29 | anderson666 | [Codepen](https://codepen.io/goodmanbuild/pen/MWdYovr) |
|  30  | hongru-LyNn | [Codepen](https://codepen.io/LyNnYWu/pen/abrzEde?editors=0011) |
|  31  | Zander | [Codepen](https://codepen.io/chuangmaster/pen/LYoEVdm) |
|  32  | LGJason | [Codepen](https://codepen.io/j811108/pen/BaeyVmE) |
| 33 | 小趴 | [Codepen](https://codepen.io/papa2415/pen/JjqoZvO)|
| 34  | zaoannihao | [Codepen](https://codepen.io/ckhwdvrx-the-solid/pen/eYamjVM) |
| 35  | ninii傳教士 | [Codepen](https://codepen.io/niiniiii/pen/NWVPLRy?editors=0011) |
| 36  | Emma | [Codepen](https://codepen.io/huang_L/pen/XWwJxmX) |
| 37  | Antonio | [Codepen](https://codepen.io/gwhvusel-the-builder/pen/bGyNMym) |
| 38  | Eileen | [Codepen](https://codepen.io/Eileen-io/pen/YzbPRRz) |
|  39  | Yuwen | [Codepen](https://codepen.io/Yuwen-the-reactor/pen/oNRgOGb?editors=0012) |
| 40 | yo0x0oy | [Codepen](https://codepen.io/Dayton-Hsieh/pen/eYamobq)|
| 41 | 快樂小豬 | [Codepen](https://codepen.io/rtjowfyf-the-lessful/pen/dyEopJM?editors=1112) |
| 42 | boin | [Codepen](https://codepen.io/boinji/pen/LYoVLRB) |
|  43  | Winnie | [Codepen](https://codepen.io/codepen-io-winnie/pen/JjqjBjm?editors=0011) |
|  44  | QOO | [Codepen](https://codepen.io/QOOQOOQ/pen/XWwbdrJ?editors=0011) |
|  45  | oyll | [Codepen](https://codepen.io/dizzydog-rgb/pen/qBGOayB) |
|  46  | 黛西 | [Codepen](https://codepen.io/ChiashengLin/pen/zYQvErO?editors=1111) |
|  47  | Haley | [Codepen](https://codepen.io/wsx3690/pen/GRapQbX?editors=1012) |
|  48  | Bruno | [Codepen](https://codepen.io/bruno-yu/pen/WNBrxYQ?editors=0011) |
|  49  | Casey | [Codepen](https://codepen.io/Caseyyyyyyyyyyyyyy/pen/LYoGaxj) |
|  50  | l.shua_228 | [Codepen](https://codepen.io/Shan-Hua-Lin-LIN-HUA/pen/NWVRgZo) |
|  51  | Shen | [Codepen](https://codepen.io/yan-Shen-the-decoder/pen/mdYroNp) |
|  52  | Sonia | [Codepen](https://codepen.io/YUJOU/pen/BaeWQjM?editors=0011) |
|  53  | 艾洛 | [Codepen](https://codepen.io/Ironance/pen/OJYpLEK?editors=0012) |
|  54  | maruko1105 | [Codepen](https://codepen.io/marukox1105/pen/KKLmMwM?editors=0111) |
| 55 | ChrisLin | [Codepen](https://codepen.io/vllzfzco-the-reactor/pen/XWwqvNQ?editors=1111) |

<!--【快速複製】    
|  num  | user | [Codepen]() |
-- >