[英]Match Regular Expression in string
I'm trying to match a page location using regular expressions in JavaScript. 我正在尝试使用JavaScript中的正则表达式来匹配页面位置。 Basically, I want to check if the string is /dashboard
+ any character, eg, /dashboard
, /dashboard/activity/
, /dashboard/myaccount
... 基本上,我想检查字符串是否为/dashboard
+任何字符,例如/dashboard
, /dashboard/activity/
, /dashboard/myaccount
...
I tried to do it using .*
: /dashboard${/.*/}
but got no luck. 我尝试使用.*
来做到这一点:/ /dashboard${/.*/}
但是没有运气。
How should I do it? 我该怎么办?
Thanks in advance 提前致谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.