LoginSignup
0

More than 5 years have passed since last update.

ファイル文字で使えるかどうか。4OS用。

Last updated at Posted at 2018-03-09

linux系は2文字しかないが、windows androidは多い。

大をとって linux apple windows androidでファイル文字として使えるかチェック。

is.fileString=(s=>!/[\\\/\:\*\?\"\<\>\|\0]|^\.{1,2}$/.test(s))
//0 moji is not
//is.fileString=(s=>!/[\\\/\:\*\?\"\<\>\|\0]|^\.{1,2}$|^.{0,0}$/.test(s))

全部

<style>input{width:22rem}</style><input></input><label></label>
let is={}
is.fileString=(s=>!/[\\\/\:\*\?\"\<\>\|\0]|^\.{1,2}$/.test(s))
;
let fn={}
fn.q=(s)=>{return document.querySelector(s)};
fn.q('input').oninput =function(ev){fn.q('label').textContent= is.fileString(this.value)}

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0