Skip to content

Commit

Permalink
add datastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
amenzai committed Dec 12, 2018
1 parent f8ed32c commit fcc554c
Show file tree
Hide file tree
Showing 5 changed files with 457 additions and 92 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@
* [](chapter7/section7.6.md)
* [](chapter7/section7.7.md)
* [排序和搜索算法](chapter7/section7.8.md)
* [算法面试总结](chapter7/section7.9.md)

4 changes: 4 additions & 0 deletions chapter2/section2.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ r2.exec(s) // null

- ^ 表示字符串的开始位置
- $ 表示字符串的结束位置

```js
// test必须出现在开始位置
/^test/.test('test123') // true
Expand All @@ -85,12 +86,15 @@ r2.exec(s) // null
(3)选择符(|)

竖线符号(|)在正则表达式中表示“或关系”(OR),即cat|dog表示匹配cat或dog。

```js
/11|22/.test('911') // true
```

上面代码中,正则表达式指定必须匹配11或22。

多个选择符可以联合使用。

```js
// 匹配fred、barney、betty之中的一个
/fred|barney|betty/
Expand Down
Loading

0 comments on commit fcc554c

Please sign in to comment.