Giter Club home page Giter Club logo

Comments (6)

azu avatar azu commented on August 19, 2024

基本的には String と RegExpの関係 が #121 にあって、
正規表現コンストラクタについてはそこまでモチベーションがない感じ。
書いてもリファレンスになってしまうので、動的に組み上げたい場合はコンストラクタを使うよってのがカバーできれば良さそうに思える(後エスケープ)

from js-primer.

azu avatar azu commented on August 19, 2024

https://regex101.com/ チェッカーツール

from js-primer.

azu avatar azu commented on August 19, 2024

exec() と同様に(またはこれとコンビで)、test() が同じグローバル正規表現インスタンスで複数回呼び出されると、前回のマッチの先に進むことになります。
https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test

https://tc39.github.io/ecma262/#sec-regexp.prototype.test
なるほど test の中身が exec だからかー

初めて知った。 あんまり //g は使わないからかな

from js-primer.

azu avatar azu commented on August 19, 2024

https://tc39.github.io/ecma262/#sec-patterns

The RegExp constructor applies the following grammar to the input pattern String. An error occurs if the grammar cannot interpret the String as an expansion of Pattern.

とあるので正規表現の中の文字列は パターン でよさそう。

new RegExp("pattern");
//          ^^^^^^^^
//          パターン文字列の部分を"パターン"
   /pattern/
// ^^^^^^^^^
// 全体が正規表現

from js-primer.

azu avatar azu commented on August 19, 2024

#121 に吸収されたので閉じる

from js-primer.

azu avatar azu commented on August 19, 2024

内部的に使ってる用語をまとめた用語集的なものをつくっておきたいな

#21 (comment) みたいなの
prhの辞書 + リンクかなー

from js-primer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.