---
# System prepended metadata

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

---

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

# 🏅 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／其他回饋                               |
|:----:|:--------------------:|:----------------------------------------------------------------------------:|
|  1   |     Rochel#4754      |           [Codepen](https://codepen.io/rochelwang1205/pen/XWxYXXq)           |
|  2   |       Nex#2964       |             [Codepen](https://codepen.io/Samuel_D4C/pen/dygKYLw)             |
|  3   |      snow#0255       |             [Codepen](https://codepen.io/snow21723/pen/RweJWed)              |
|  4   |   Kulimusoda#2785    |      [Codepen](https://codepen.io/yuch3n_chen/pen/yLREeWx?editors=0012)      |
|  5   |     Quantum#6093     |            [Codepen](https://codepen.io/Min-Hao-Hung/pen/QWZBqax)            |
|  6   |    andychiou#4830    |           [Codepen](https://codepen.io/andychiou1113/pen/ExdRKjq)            |
|  7   |     Berlin#7338      |       [Codepen](https://codepen.io/3qberlin/pen/vYVrLoK?editors=0010)        |
|  8   |      DeLi#8324       |            [Codepen](https://codepen.io/delichaomoon/pen/abRKNrB)            |
|  9   |      汪汪#4486       |             [Codepen](https://codepen.io/hunwooooof/pen/BaqVzBv)             |
|  10  |      Eero#1147       |      [Codepen](https://codepen.io/Eero-Chiao/pen/jOeKqxd?editors=1011)       |
|  11  |      雲漢#5319       |        [codepen](https://codepen.io/keon981/pen/rNqKLyW?editors=0012)        |
|  12  |      SKey#9905       |             [codepen](https://codepen.io/Dale-Chien/pen/yLREerq)             |
|  13  |     JimWang#6134     | [codepen](https://codepen.io/Jim-Wang-the-selector/pen/abRKmZa?editors=0011) |
|  14  |      冬天#5215       |              [codepen](https://codepen.io/winter_/pen/WNayGpp)               |
|  15  |     jia yu#8896      |        [codepen](https://codepen.io/fjqxaznl-the-reactor/pen/WNayorJ)        |
|  16  |       翔.#0859       |     [codepen](https://codepen.io/energy95272z/pen/RweJoLg?editors=0012)      |
|  17  |    Jacky7035#9423    |              [codepen](https://codepen.io/adens123/pen/dygKXQg)              |
|  18  | K（アギルダー）#0386 |             [codepen](https://codepen.io/klay376014/pen/yLREVjW)             |
|  19  |     Eden.C#9359      |               [codepen](https://codepen.io/iseden/pen/JjmZRGm)               |
|  20  |      gahwa#3562      |              [codepen](https://codepen.io/gahwa17/pen/BaqVQvO)               |
|  21  |      Akira#9996      |             [codepen](https://codepen.io/Akira-Chen/pen/xxyzqOy)             |
|  22  |     ChaosTu#9311     |        [codepen](https://codepen.io/torotu/pen/LYgrRXP?editors=0012)         |
|  23  |     jackwu#4437      |           [codepen](https://codepen.io/jackwu1588003/pen/MWPXove)            |
|  24  |     jelly77#2088     |      [codepen](https://codepen.io/Ming-chiang/pen/mdzKOqB?editors=0011)      |
|  25  |     jimhop#6510      |      [Codepen](https://codepen.io/jimsansssss/pen/VwEdbWm?editors=1111)      |
|  26  |      辣椒#1002       |            [Codepen](https://codepen.io/chilichen118/pen/MWPXvjO)            |
|  27  |    司機叔叔#2463     |       [Codepen](https://codepen.io/bigv5566/pen/vYVrZVv?editors=1010)        |
|  28  |    alexmav04#5048    |       [Codepen](https://codepen.io/alexmav04/pen/MWPXreE?editors=0012)       |
|  29  |     wiimax#4564      |       [codepen](https://codepen.io/willismax/pen/KKGebda?editors=0011)       |
|  30  |      Zhong#8917      |        [codepen](https://codepen.io/klfjrlod-the-sasster/pen/ExdRGKL)        |
|  31  |      兔子#6746       |           [codepen](https://codepen.io/CarrotDetector/pen/WNayLKO)           |
|  32  |      姜承#8204       |              [codepen](https://codepen.io/Troy0718/pen/wvYXNQx)              |
|  33  |     銀光菇#1692      |           [codepen](https://codepen.io/genesynthesis/pen/mdzKaPN)            |
|  34  | Jennifer Chuang#3937 |        [codepen](https://codepen.io/yujhen/pen/wvYXEgG?editors=1111)         |
|  35  |    HsuanTang#1349    |             [codepen](https://codepen.io/HsuanTang/pen/BaqVeOx)              |
|  36  |      Judy☻#7874      |       [Codepen](https://codepen.io/hsiaohan/pen/PoyaVWK?editors=0011)        |
|  37  |    David0799#4415    |             [Codepen](https://codepen.io/David0799/pen/NWOzZaZ)              |
|  38  |      Janet#5784      |      [Codepen](https://codepen.io/janetlinnn/pen/qBJKzgo?editors=1111)       |
|  39  |     Yvonne#2721      |        [Codepen](https://codepen.io/Evonne/pen/RweJXeP?editors=1010)         |
|  40  |      泊岸#3466       |      [Codepen](https://codepen.io/qoq77416416/pen/NWOBWXZ?editors=1012)      |
|  41  | charlottelee849#0366 |        [Codepen](https://codepen.io/char849/pen/MWPBeKg?editors=0012)        |
|  42  |    變羊魔法#6372     |             [Codepen](https://codepen.io/cssf998811/pen/eYPjBqO)             |
|  43  |       Uli#1946       |              [Codepen](https://codepen.io/uli1313/pen/BaqPRNW)               |
|  44  |   Jerry456789#9029   |              [Codepen](https://codepen.io/aria198a/pen/dygjWpo)              |
|  45  |      duck#3310       |              [Codepen](https://codepen.io/papy0715/pen/jOepaWR)              |
|46|肉個阿倫#7172|[Codepen](https://codepen.io/i9574385/pen/poxZOGW)|
|47|Aritan#1931|[Codepen](https://codepen.io/Aritan/pen/QWZVGYx)|
|48|長方形#9612|[Codepen](https://codepen.io/imjjw/pen/wvYXRZd)|
|49|liam9930#4129|[Codepen](https://codepen.io/jgnjfvvt-the-lessful/pen/ZEqMgEQ?editors=0011)|
|50|東東#5015|[Codepen](https://codepen.io/wearymask/pen/JjmmoXy)|
|51|jun777#2468|[Codepen](https://codepen.io/js18151102/pen/wvYYaPg?editors=0011)|
|52|鄭舜仁#6606|[Codepen](https://codepen.io/randomno/pen/poxQjRO)|
|53|阿榮#8277|[Codepen](https://codepen.io/codeitaday/pen/oNaQbjw?editors=0011)|
|54|wendyli#2155|[Codepen](https://codepen.io/rockayumitw/pen/RweqEGx?editors=0011)|
|55|JasonChang#7847|[Codepen](https://codepen.io/jsonChangJava/pen/vYVQoxW)|
|56|MitA#7407|[Codepen](https://codepen.io/qaz15996398/pen/qBJLOre)|
|57|FanJJ#8061|[Codepen](https://codepen.io/yfchenn/pen/LYgqPoX?editors=0011)|
|57|科科#5463|[Codepen](https://codepen.io/ilove941120/pen/XWxOMMv?editors=1111)|
|57|JhouHank#8132|[Codepen](https://codepen.io/JhouHank/pen/BaqMJYx)|
|58|狸貓#5863|[Codepen](https://codepen.io/tanuki320/pen/eYPxwBe?editors=1011)|
|59|羽毛#5463|[Codepen](https://codepen.io/KYuFeather/pen/JjmzEPL)|
|60|小明#4408|[Codepen](https://codepen.io/ujlylmbv-the-lessful/pen/mdzgKxX)|
|61|Jaredlee#5887|[Codepen](https://codepen.io/jared-lee/pen/YzJbPmW?editors=0011)|
|62|townyuan#2653|[Codepen](https://codepen.io/townyuan/pen/Poydvgm)|
| 63 | Kaya#8857 | [Codepen](https://codepen.io/laron9486/pen/QWJbNeG) |
| 64 | Ann Chou#0146 | [Codepen](https://codepen.io/annchou_illu/pen/jOQPdJq) |
| 65 | betty#0693 | [Codepen](https://codepen.io/betty-hu/pen/XWogWer?editors=0012) |