Skip to content

Instantly share code, notes, and snippets.

@externvoid
Last active September 2, 2018 23:55
Show Gist options
  • Select an option

  • Save externvoid/3838530ab0babfef19784af08f0c4fcf to your computer and use it in GitHub Desktop.

Select an option

Save externvoid/3838530ab0babfef19784af08f0c4fcf to your computer and use it in GitHub Desktop.
正規表現メタ文字の覚え方

., *, +, ?、この4つの意味は?

. = any

*, +, ?、ベクトル内積、論理演算を思い出す

* = 1 x 1 x cos60 = 1/sqr(3) = 0
+ = 1
? = or

だから、

  • * 0個以上の連続
  • + 1個以上の連続
  • ? 0 or 1個のみ
  • 単独では用いない。必ず連続する対象と共に用いる

MSDOSを思い出す

dir *.txt

これは、ワイルドカードであって正規表現では無い。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment