0.3.0 • Published 7 months ago

rd-regexp-ahk v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Class rd_RegExp

Installation

In a terminal or command line, navigate to your project folder:

npm install rd-regexp-ahk

In your code include the following:

#Include, %A_ScriptDir%\node_modules\rd-regexp-ahk\rd_RegExp.ahk

re := new rd_RegExp()

Description

A class to manage regular expressions in Autohotkey.

This class will always use match objects, the flag O) will be added automatically.

All methods have function comments and if you're looking for examples check out the tests.

If you use the VS Code AutoHotkey Plus Plus extension, you might also want to check out Peak Definition (Alt+F12) or Go To Definition (F12).

This class will throw an exception in case of a serious error by default which works well in combination with a global error handler. This behavior can be changed by setting rd_RegExp.throwExceptions := false.

Methods

MethodDescription
setPcreOptionsSets PCRE options to be auto-generated
getPcreOptionsGets PCRE options
splitRegexSplits RegEx pattern into flags/pattern
matchRetrieves the result of matching a string against a RegEx
matchBFor Boundfunc: Retrieves the result of matching a string against a RegEx
IsMatchBFor Boundfunc: Retrieves the boolean result of matching a string against a RegEx
matchAllretrieves all the results of matching a string against a RegEx
filterAllFilters array of match objects by group
replaceReplaces occurrences of a RegEx inside a string, optionally using a callback function
replaceBFor Boundfunc: Replaces occurrences of a RegEx inside a string, optionally using a callback function
escapeStringEscapes RegEx string