Invalid regular expression error

前端 未结 4 816
清酒与你
清酒与你 2021-01-19 06:35


I\'m trying to retrieve the category part this string \"property_id=516&category=featured-properties\", so the result should be \"featured-properties\

4条回答
  •  遇见更好的自我
    2021-01-19 06:58

    If you want to parse URL parameters, you can use the getParameterByName() function from this site:

    • http://james.padolsey.com/javascript/bujs-1-getparameterbyname/

    In any case, as already mentioned, regular expressions in JavaScript are not plain strings:

    • https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions

提交回复
热议问题