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

l3regex: TeX で実装された正規表現エンジン / l3regex

Watson
October 18, 2019

l3regex: TeX で実装された正規表現エンジン / l3regex

Watson

October 18, 2019
Tweet

More Decks by Watson

Other Decks in Programming

Transcript

  1. l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ ؆୯ͳࣗݾ঺հ ே૔୎ਓ(wtsnjp) ▶ ϋϯυϧωʔϜɿϫτιϯ ▶ ૊൛γεςϜ TEX

    ͕େ޷͖ ˠ TEX Live νʔϜ ϝϯόʔ ▶ म࢜ 2 ೥ʢ૯ݚେ / NII / ౦େʣ ▶ ݱࡏͷઐ߈ɿࣗવݴޠॲཧ (NLP) ......ͱশͭͭ͠ɼ࣮ͷݚڀର৅͸਺ࣜ ʮ͢΂ͯͷಓ͸ TEX ʹ௨ͣʯ 2 / 7
  2. l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ l3regexͷίί͕εΰΠʂ l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ ϙΠϯτᶃ কདྷੑ͕εΰΠ ∵)

    L A TEX3 ϓϩδΣΫτͷҰ෦ ϙΠϯτᶄ ࣮૷͕εΰΠ ∵) ଠݹͷݴޠ TEX Ͱ࣮૷͞Ε͍ͯΔ ϙΠϯτᶅ ࣮༻ੑ͕εΰΠ ∵) ໌೔͔Βۀ຿Ͱ࢖͑Δ 3 / 7
  3. l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ ϙΠϯτᶃ কདྷੑ͕εΰΠ L A TEX3 ϓϩδΣΫτ ▶

    L A TEX2 ͷޙܧ ▶ 3 ϨΠϠߏ੒ʢܭըʣ ▶ 1990 ೥୅தࠒ͔Β ˠ TEX քͷαάϥμ ϑΝϛϦΞ expl3 ϓϩάϥϛϯάݴޠ ʢ໊শະఆʣ ϨΠΞ΢τઃܭݴޠ L A TEX3 ϚʔΫΞοϓݴޠ expl3 ݴޠ ▶ TEX ্ʹ࣮૷͞Εͨϓϩάϥϛϯάݴޠ ▶ L A TEX2 ։ൃऀάϧʔϓ͕อकɾ։ൃ ࢀߟɿϥϯάɾϥάʔʰTeX ݴޠऀͷͨΊͷ expl3 ೖ໳ʱ 4 / 7
  4. l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ ϙΠϯτᶄ ࣮૷͕εΰΠ TEX ݴޠͷίί͕ΞϨ ▶ ໊લۭؒͷܽ೗ɼల։੍ޚɼ෭࡞༻ɼetc. ▶

    ࣈ۟ղੳʹνϡʔϦϯάϚγϯ͕ඞཁʂ l3regex ͸ TEX ݴޠͰ࣮૷͞Ε͍ͯΔ ▶ l3regex ͷ࣮૷ɿTEX ݴޠ੡ͷ NFA Τϯδϯ ▶ TEX ύοέʔδ͸ TEX ݴޠͰ࣮૷ͦ͜ਖ਼ٛ ∵) ͋ΒΏΔ TEX ؀ڥɾॲཧܥͰಈ࡞ ʮTEX ʹ͍Δͱ͖͸ TEX ܳਓͷ͢ΔΑ͏ʹͤΑʯ 5 / 7
  5. l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ ϙΠϯτᶅ ࣮༻ੑ͕εΰΠ l3regex ͸ҙ֎ͱʢʁʣී௨ͷϥΠϒϥϦ RGB ࢦఆΛղੳ͢Δྫ 1

    \regex_extract_once:nnN 2 { \A rgb([0-9x])([0-9x])([0-9x]) \Z } 3 { #1 } \l_coloring_temp_seq Ͳ͜Ͱ࢖͑Δͷʁ ▶ TEX Live, MiKTEX ಋೖࡁ ⇔ Overleaf Ͱ΋ OK ▶ TEX ॲཧܥɿpdfTEX, (u)pTEX, X E TEX, LuaTEX ˠ͓͓Αͦͷ TEX ؀ڥͰ࠷ॳ͔Βར༻Մೳʂ ʮTEX ͸ 1 ೔ʹͯ͠ͳΒͣʯ 6 / 7
  6. l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ ·ͱΊ l3regex: TEX Ͱ࣮૷͞Εͨਖ਼نදݱΤϯδϯ ϙΠϯτᶃ L A

    TEX3 ͷҰ෦Ͱকདྷੑ͋Γ ϙΠϯτᶄ TEX ݴޠͰ࣮૷͞Ε͍ͯΔ ϙΠϯτᶅ ໌೔͔Β࢖͑Δਖ਼نදݱϥΠϒϥϦ ৄࡉ͸ެࣜϦϑΝϨϯεΛࢀরɿ $ texdoc interface3 Thank you & Happy TEXing! 7 / 7