dwscripts.escRegExpChars

DreamweaverのExtensionを作っているときに正規表現を使う必要があったのだけれど、それに関連したユーティリティー関数。Configuration/Shared/Common/Scripts/dwscripts.js に定義されている。
dwscripts.escRegExpChars("<$MTCalendarDay$>")
のように使うと、正規表現でエスケープする必要がある文字をエスケープした文字列を返してくれる。なので、
RegExp(dwscripts.escRegExpChars("<$MTCalendarDay$>"), "ig")
とすることで、簡単に正規表現オブジェクトを作ることが出来る。

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>