Javascript模式匹配

时间:2010-09-21 09:37:34

标签: 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

1 个答案:

答案 0 :(得分:0)

正则表达式在这里很有用

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

要提供更详细的答案,您需要告诉我们您要从此字符串中提取的内容。

相关问题