Home >Web Front-end >JS Tutorial >javascript Get the regular expression within the first slash in the linked file address_javascript skills

javascript Get the regular expression within the first slash in the linked file address_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:51:491252browse

window.location.pathname
比如:
/windows/location/page.html
我想得到“windows”,请问用正则表达式怎么写?


[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn