Last active
January 31, 2020 00:05
-
-
Save jiyuujin/27c37024561dcedd580af2cfd3e3c881 to your computer and use it in GitHub Desktop.
location.hrefからhtmlファイル名を取得する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getLinkUrlWithExtention = url => { | |
return url.match('.+/(.+?)([?#;].*)?$')[1] | |
} | |
export const getLinkUrlWithoutExtention = url => { | |
return url.match('.+/(.+?).[a-z]+([?#;].*)?$')[1] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getLinkUrlWithExtention = (url: string): string => { | |
return url.match('.+/(.+?)([?#;].*)?$')[1] | |
} | |
export const getLinkUrlWithoutExtention = (url: string): string => { | |
return url.match('.+/(.+?).[a-z]+([?#;].*)?$')[1] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment