Last active
May 5, 2024 17:16
-
-
Save uprime22/64db67c1f7ac756fc1de860f6f2fae26 to your computer and use it in GitHub Desktop.
適当な文字列から、半角英数日本語ピリオド以外を除きファイル名に使えそうな文字列を再構築する正規表現
This file contains 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
function makeFilename(s){ | |
var filename = | |
s.replace(/[^\.A-Za-z0-9\u30e0-\u9fcf\u3040-\u309f\u30a0-\u30ff]/gi, ''); | |
return (filename); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment