rd-regexp-ahk

0.3.0 • Public • Published

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

Method Description
setPcreOptions Sets PCRE options to be auto-generated
getPcreOptions Gets PCRE options
splitRegex Splits RegEx pattern into flags/pattern
match Retrieves the result of matching a string against a RegEx
matchB For Boundfunc: Retrieves the result of matching a string against a RegEx
IsMatchB For Boundfunc: Retrieves the boolean result of matching a string against a RegEx
matchAll retrieves all the results of matching a string against a RegEx
filterAll Filters array of match objects by group
replace Replaces occurrences of a RegEx inside a string, optionally using a callback function
replaceB For Boundfunc: Replaces occurrences of a RegEx inside a string, optionally using a callback function
escapeString Escapes RegEx string

Readme

Keywords

Package Sidebar

Install

npm i rd-regexp-ahk

Weekly Downloads

4

Version

0.3.0

License

MIT

Unpacked Size

11.9 kB

Total Files

5

Last publish

Collaborators

  • rliess