並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 15 件 / 15件

新着順 人気順

regexpの検索結果1 - 15 件 / 15件

  • Regexp::AssembleのGo実装 rassemble-go を作りました - プログラムモグモグ

    PerlにはRegexp::Assembleという便利なライブラリがあります。 複数の正規表現を受け取り、それらのいずれかにマッチする正規表現を構築するためのライブラリです。 my $ra = Regexp::Assemble->new; $ra->add( 'ab+c' ); $ra->add( 'ab+\\d*\\s+c' ); $ra->add( 'a\\w+\\d+' ); $ra->add( 'a\\d+' ); print $ra->re; # prints (?:a(?:b+(?:\d*\s+)?c|(?:\w+)?\d+)) このライブラリのGo実装を金曜日の夜から書き始めて、ようやく形になってきたので公開しました。 package main import ( "fmt" "log" "github.com/itchyny/rassemble-go" ) func main

      Regexp::AssembleのGo実装 rassemble-go を作りました - プログラムモグモグ
    • 正規表現を豊かにする ES2024 RegExp v (unicodeSets) フラグ

      【2023/05/17 変更】 2023年5月の TC39 会議で Stage 4 になったため、タイトルを変更 HTML Standard の pattern 属性に取り込まれたので修正 ES2024 RegExp v (unicodeSets) フラグ ES2024 に RegExp v (unicodeSets) フラグというものがあります。これは既存の u (unicode) フラグを改善して置き換え、機能追加することを目的としています。 詳しい内容については V8 や 2ality による解説記事が詳しいです。ここではその概要をピックアップして述べたいと思います。 複数のコードポイントからなる絵文字の対応(Unicode Properties of Strings) ES2015 に u (unicode) フラグが導入され、コードポイント単位で正規表現を扱えるようになりました。

        正規表現を豊かにする ES2024 RegExp v (unicodeSets) フラグ
      • JSで書かれたECMAScript RegExpパーサーの比較 | Memory ice cubes

        OXCで正規表現パーサーを実装してるときに全部一通り読んでみて、みんな違ってみんな良いってなったので。 候補はこちらの3つ。 https://github.com/jviereck/regjsparser https://github.com/DmitrySoshnikov/regexp-tree https://github.com/eslint-community/regexpp かのAST Explorerでも、RegExp部門ではこの3つがリストにある。 AST explorer https://astexplorer.net/ 前提 ECMAScript本体だと、ESTreeというデファクトがあるけど、残念ながらRegExpにはない。 ESTreeでのRegExpの扱いはこんな感じで、ただの文字列でしかない。 interface RegExpLiteral <: Literal

          JSで書かれたECMAScript RegExpパーサーの比較 | Memory ice cubes
        • 2022-11-22のJS: State of JavaScript 2022のアンケートを実施中、RegExp `v` flag

          JSer.info #619 - 毎年行われているJavaScript開発者向けのアンケートである State of JavaScript 2022 が開催されています。 State of JavaScript 2022 言語機能やフレームワークなどについてのアンケートをとっていて、2022年12月15日まで受付けています。 過去の結果については次のページで公開されています。 The State of JS 2021 State of JS 2020 ECMAScript proposal: RegExp flag /v makes character classes and character class escapes more powerfulという記事では、現在ECMAScript Proposal Stage 3のRegExp v flagについて解説されています。 正規表現のv

            2022-11-22のJS: State of JavaScript 2022のアンケートを実施中、RegExp `v` flag
          • GitHub - unjs/magic-regexp: A compiled-away, type-safe, readable RegExp alternative

            You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

              GitHub - unjs/magic-regexp: A compiled-away, type-safe, readable RegExp alternative
            • ECMAScript proposal: RegExp flag `/v` makes character classes and character class escapes more powerful

              ECMAScript proposal: RegExp flag /v makes character classes and character class escapes more powerful In this blog post, we look at the ECMAScript proposal “RegExp v flag with set notation + properties of strings” by Markus Scherer and Mathias Bynens. The new flag /v  # The proposed new regular expression flag /v (.unicodeSets) enables three features: Support for multi-code-point graphemes (such a

              • GitHub - tc39/proposal-regexp-v-flag: UTS18 set notation in regular expressions

                You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                  GitHub - tc39/proposal-regexp-v-flag: UTS18 set notation in regular expressions
                • libc同梱のPOSIX regexpを使うmgemを公開した - ローファイ日記

                  こちらです。 github.com とにかくカジュアルに、簡単でもいいので正規表現を使いたい場面にマッチすると思う。 簡単なベンチを取った。 他の主要な3つのmgem(mruby-onig-regexp/mruby-regexp-pre/mruby-pure-regexp)と比較して、結果的に mruby-posix-regexp が一番ビルド時間、バイナリサイズともに小さくなるという結果になった。 ベンチの内容 まず、 mruby 3.0.0 において、以下ような最小限の build_config.rb を用いた。 MRuby::Build.new do |conf| conf.toolchain conf.gem mgem: 'mruby-onig-regexp' #conf.gem mgem: 'mruby-regexp-pcre' #conf.gem mgem: 'mruby-pu

                    libc同梱のPOSIX regexpを使うmgemを公開した - ローファイ日記
                  • 特定のパスからのアクセスか判定したい&RegExpとリテラルの差について(JS:正規表現) - Qiita

                    Javascript(以下JS)で特定のパスからのアクセスか判定したい場合がありました。正規表現で対応しようと考えたのですが、意外に悩まされたので、簡単にまとめておこうと思います。完成したコードがこちら。 let pathname = '/index/5/edit/' if (new RegExp(/\/index\/.*\/edit/).test(pathname)) { console.debug('該当のURLからのアクセスです。'); } ここでは「/index/5/edit/」というパスからきた場合、debugで「該当のURLからのアクセスです。」という文言を表示させるようにしています。パスに含まれる5ですが、ここではユーザーIDとして、この部分は動的に変わることを想定しています。それでは正規表現の解説をしていきます。

                      特定のパスからのアクセスか判定したい&RegExpとリテラルの差について(JS:正規表現) - Qiita
                    • Unicode sorting is hard & why browsers added special emoji matching to regexp

                      Unicode sorting is hard & why browsers added special emoji matching to regexp As I work on Zorex, an omnipotent regexp engine I have stumbled into a world of tales about why Unicode text sorting is so annoying in the modern day. Let’s talk about that. Why ASCII sorting is not enoughTwitter’s emoji problem - or when Unicode locale-aware sorting Really Matters™Browsers added special emoji matching t

                      • An additional non-backtracking RegExp engine · V8

                        Show navigation Starting with v8.8, V8 ships with a new experimental non-backtracking RegExp engine (in addition to the existing Irregexp engine) which guarantees execution in linear time with respect to the size of the subject string. The experimental engine is available behind the feature flags mentioned below. Runtime of /(a*)*b/.exec('a'.repeat(n)) for n ≤ 100Here’s how you can configure the n

                        • Ruby 3.2 で ReDoS 対策/改善のために追加された `Regexp.timeout=` について - Qiita

                          はじめに この記事は、記事投稿キャンペーン「【RubyKaigi 2023 連動イベント】みんなで Ruby の知見を共有しよう」の記事です RubyKaigi 2023 の Day 2 (2023/05/12) 16:00 - 16:30 Takashi Yoneuchi (tw:@lmt_swallow)さんの 「Eliminating ReDoS with Ruby 3.2 」 でお話があった ReDoS のタイムアウトについて実際に動かして検証してみました。 ReDoS について ReDoS は、Regular expression Denial of Service の略称です 正規表現の評価に時間がかかる文字列を入力しリソースを占有する攻撃です。 ReDoS について詳しくまとめてくださっている @flat-field さんの記事のリンクを張り説明は省略します。 また、 Rub

                            Ruby 3.2 で ReDoS 対策/改善のために追加された `Regexp.timeout=` について - Qiita
                          • 正規表現 / RegExp_2021

                            組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition

                              正規表現 / RegExp_2021
                            • 「Google Chrome 136」が公開 ~新しい静的メソッド RegExp.escape() などを導入/セキュリティ関連の修正は全8件

                                「Google Chrome 136」が公開 ~新しい静的メソッド RegExp.escape() などを導入/セキュリティ関連の修正は全8件
                              • GitHub - antfu/oniguruma-to-js: Covert Oniguruma-flavor Regexp to JavaScript native RegExp.

                                You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                  GitHub - antfu/oniguruma-to-js: Covert Oniguruma-flavor Regexp to JavaScript native RegExp.
                                1