- 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及C++程序設計(第4版)
- 嵌入式軟件系統測試:基于形式化方法的自動化測試解決方案
- MySQL數據庫應用與管理 第2版
- Reactive Programming with Swift
- Mastering Python Scripting for System Administrators
- 零基礎學MQL:基于EA的自動化交易編程
- INSTANT OpenNMS Starter
- ElasticSearch Cookbook(Second Edition)
- ScratchJr趣味編程動手玩:讓孩子用編程講故事
- Clean Code in C#
- Fastdata Processing with Spark
- Arduino Wearable Projects
- Simulation for Data Science with R
- Mastering Bootstrap 4
- Blender 3D Cookbook