- JavaScript:Moving to ES2015
- Ved Antani Simon Timms Narayan Prusty
- 101字
- 2021-07-09 19:07:34
Beginning and end
Frequently, we may wish to ensure that a pattern matches at the beginning of a string or perhaps at the end of a string. The caret character, when used as the first character of the RegEx, anchors the match at the beginning of the string such that /^test/
matches only if the test substring appears at the beginning of the string being matched. Similarly, the dollar sign ($
) signifies that the pattern must appear at the end of the string: /test$/
.
Using both ^
and $
indicates that the specified pattern must encompass the entire candidate string: /^test$/
.
推薦閱讀
- C++ Primer習題集(第5版)
- Learning LibGDX Game Development(Second Edition)
- iOS Game Programming Cookbook
- 深入理解Android(卷I)
- Design Principles for Process:driven Architectures Using Oracle BPM and SOA Suite 12c
- Mastering Python Scripting for System Administrators
- Instant Typeahead.js
- Python程序設計案例教程
- 你必須知道的204個Visual C++開發問題
- Learn React with TypeScript 3
- HTML5+CSS3網頁設計
- 青少年學Python(第1冊)
- Kotlin從基礎到實戰
- Solr Cookbook(Third Edition)
- Python機器學習:預測分析核心算法