Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[正規表現]メタ文字をはじめから丁寧に

ken3ypa
October 27, 2018
290

 [正規表現]メタ文字をはじめから丁寧に

Tama.rb 2018/10/27(土)発表

ken3ypa

October 27, 2018
Tweet

Transcript

  1. ࠷௿ݶʝ [\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x 80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\ \x80-\xff\n\015()]*)*\)[\040\t]*)*(?:(?:[^(\040)<>@,;:".\\\[\]\000 -\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\ \\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\04 0\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\ xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80 -\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\0 15()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\x

    ff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t] *)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:" .\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xf f][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*( ?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\ \x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*@[ \040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x8 0-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\ x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\03 7\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\ \\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\x
  2. {n} ߲໨ આ໌ ه߸ \O^ ಡΈํ ϒϨʔε
 ೾ׅހɺதׅހ ػೳ ௚લͷจࣈ΍άϧʔϓͷ


    OճҎ্ͷ܁Γฦ͠ʹϚον ༻ྫ IUUQSVCVMBSDPNS U[U,L+C
  3. {n}ͷछྨ ճ਺ͷߜΓࠐΈ͕Ͱ͖ΔͷͰɺޮ཰త͔ͭ҆৺ײ͕͋Δ ߲໨ \O^ \O ^ \ O^ \O N^

    ػೳ
 ௚લͷจࣈΛ Oճ OճҎ্ OճҎԼ OճҎ্NճҎ Լ
  4. ·ͱΊ ճ਺ ه߸ ҙຯ  ճҎ্ͷ܁Γฦ͠ʹ Ϛον d ճҎ্ͷ܁Γฦ͠ʹ Ϛον

    PS ճ·ͨ͸ճͷ܁Γ ฦ͠ʹϚον ࢦఆճ਺ \O^ Oճͷ܁Γฦ͠ʹ Ϛον ࢦఆճ਺Ҏ্ \O ^ OճҎ্ͷ܁Γฦ͠ʹ Ϛον ࢦఆճ਺Ҏ্ɺࢦఆճ ਺ҎԼ \O N^ OճҎ্NճҎԼͷ ܁Γฦ͠ʹϚον
  5. \ ߲໨ આ໌ ه߸ a ಡΈํ όοΫεϥογϡ ػೳ ɾϝλจࣈΛΤεέʔϓ͢Δ ɾa

    ಛఆͷӳࣈͰจࣈͷলུه๏Λ࡞Δ ༻ྫ IUUQSVCVMBSDPNSJDR2[UQJ"
  6. จࣈͷলུه๏ লུه๏ આ໌ লུݩ උߟ aX ӳ਺ࣈ <B[";@> XPSE a8

    ඇӳ਺ࣈ <?B[";@> 803% aT ۭനจࣈ <aUaSaOaGaW> TQBDF a4 ඇۭനจࣈ <?aUaSaOaGaW> 41"$& aE ਐ਺ࣈ <> EJHJU a% ඇਐ਺ࣈ <?> %*(*5 aI ਐ਺ࣈ <BG"'> IFYBEFDJNBM OVNCFS a) ඇਐ਺ࣈ <?BG"'> )&9"%&$*."- /6.#&3 Մಡੑ͕͕͋ΔͷͰͥͻ࢖͍͖ͬͯ·͠ΐ͏