开发者

Javascript pattern matching

开发者 https://www.devze.com 2023-01-17 10:55 出处:网络
In a string if we k开发者_JAVA技巧now a start point .how to find the end string using js or jquery

In a string if we k开发者_JAVA技巧now a start point .how to find the end string using js or 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


Regular expressions will be useful here

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

To provide a more detailed answer you need to tell us what are you trying to extract from this string.

0

精彩评论

暂无评论...
验证码 换一张
取 消