2分钟
全局搜索(Global search)
修饰符 g 常用于执行一个全局搜索匹配,即(不仅仅返回第一个匹配的,而是返回全部)。 例如,表达式 /.(at)/g 表示搜索 任意字符(除了换行)+ at,并返回全部结果。
"/.(at)/" => The fat cat sat on the mat."/.(at)/g" => The fat cat sat on the mat.修饰符 g 常用于执行一个全局搜索匹配,即(不仅仅返回第一个匹配的,而是返回全部)。 例如,表达式 /.(at)/g 表示搜索 任意字符(除了换行)+ at,并返回全部结果。
"/.(at)/" => The fat cat sat on the mat."/.(at)/g" => The fat cat sat on the mat.Copyright © 2013-2026 Tencent Cloud.All Rights Reserved. 腾讯云 版权所有
学员评价