タグ

regexに関するkotasのブックマーク (2)

  • 正規表現の脆弱性 (ReDoS) を JavaScript で学ぶ

    先日、このようなツイートを書いたところ、かなりの反響がありました。 JavaScript の正規表現の脆弱性の例でいうと、例えば /\s+$/ は脆弱性があると言える console.time(); /\s+$/.test(" ".repeat(65536) + "a"); console.timeEnd(); 結構時間がかかるのがわかる。でも /\s+$/ を見て「これは危険だな」と理解出来る人はそんなにいない。JavaScript に限らないけれど。 — Takuo Kihira (@tkihira) February 17, 2022 これは一般に ReDoS (Regular expression Denial of Service) と呼ばれる脆弱性です。正確に理解するのが難しい脆弱性なので、少し解説してみたいと思います。 結論 長い記事になるので、最初に「とりあえずこれだけ知っ

  • RegEx Crossword

    It's a crossword puzzle where you need to fill in the hexes with character sequences, so that they match the regular expressions listed around the edges. The individual clues will turn bold purplebold green when satisfied, orangered when not, and underlined when active. Note that the regex must be a full match, and empty cells are treated as spaces. Double click a rule to edit it. When finished, p

    kotas
    kotas 2021/03/14
    楽しかった。脳内で Cracking The Cryptic の Simon が「Aha!」って言いまくってた。
  • 1