如何解决在Javascript中使用正则表达式的问题
how to solve using regular expression in Javascript
我正在从json中获取类似的android url
"https:'/'/play.google.com'/store'/apps'/details?id=com.lego.starwars.thenewyodachronicles&hl=en"
现在我只想要上面URL中的包名称:->"com.lego.starwars.newyodachronicles"
如何在javascipt 中使用正则表达式来解决它
提前Thanx:)
您需要使用前瞻性。
[^=&]+(?=&)
代码:
> "https://play.google.com/store/apps/details?id=com.lego.starwars.thenewyodachronicles&hl=en".match(/[^=&]+(?=&)/g)
[ 'com.lego.starwars.thenewyodachronicles' ]
^.*?=(['w.]+).*$
试试这个。请参阅演示。
http://regex101.com/r/kM7rT8/9
相关文章:
- Javascript中的正则表达式问题转义特殊字符
- AngularJS ng-pattern的正则表达式问题
- 匹配 JavaScript 中的字符串时的正则表达式问题
- angularjs 的正则表达式问题
- 解决正则表达式问题;验证js
- 电子邮件正则表达式问题
- 发现正则表达式问题中的字符
- Javascript正则表达式问题-只匹配部分结果
- Javascript正则表达式问题
- 活体验证-正则表达式问题
- javascript中的正则表达式问题
- jquery正则表达式问题匹配任何字符串a-zA-Z0-1
- Javascript正则表达式问题
- Javascript正则表达式问题
- 正则表达式问题-替换浮点数,而不是整型
- Javascript正则表达式问题
- Javascript正则表达式问题
- Javascript正则表达式问题与facebook链接
- 包含UTF-8字符的字符串的Javascript正则表达式问题
- NodeJS中的URL正则表达式问题