Javascript模式匹配

Javascript模式匹配,javascript,jquery,Javascript,Jquery,如果我们知道一个起始点,那么在一个字符串中。如何使用js或jquery查找结束字符串 var helper="$var_1__ee$var_2__ee"; $var is the starting point and the end string pattern is ee How to split the string based on this pattern 正则表达式在这里很有用 helper.match(/$var[^$]*ee/) 要提供更详细的答案,您需要

如果我们知道一个起始点,那么在一个字符串中。如何使用js或jquery查找结束字符串

   var helper="$var_1__ee$var_2__ee";

    $var is the starting point and the end string pattern is ee

  How to split the string based on this pattern

正则表达式在这里很有用

helper.match(/$var[^$]*ee/)

要提供更详细的答案,您需要告诉我们您试图从这个字符串中提取什么。

匹配的字符串应该替换为$glob\u l\u eeI仍然不清楚您试图做什么,但这可能是有用的
helper.replace(/$var[^$]*ee/,“$glob\u l\u ee”)
今天正在下雨的字符串模式。或多或少都有相同的问题这只是一个例子,还是你真的想要这些?我想插入这些模式