- don't use MS Notepad compatibility mode when parsing command line parameters. | |
- print next file and close it. | |
- silently create new file, if it doesn't exist. | |
- don't create new file, if it doesn't exist. | |
- ask for new file creation, if it doesn't exist (by default). | |
- silently open file, if binary. | |
- don't open file, if binary. | |
- ask for file open, if binary (by default). | |
- silently save file, even if symbols will be lost in specified encoding. | |
- don't save file, if symbols will be lost in specified encoding. | |
- ask for file save, if symbols will be lost in specified encoding (by default). | |
- ignore next command line parameter. | |
- force create new program instance. | |
- set class name for a new program instance. Name could contain variable %d, which is replaced with process id. | |
- reinstall assigned earlier associations of file types. | |
- uninstall assigned earlier associations of file types. | |
- stop parsing command line parameters and close program. | |
- stop parsing command line parameters. |
Methods:
MainWindowStyle
0 hidden window.
1 window as is (by default).
2 minimized window.
3 maximized window.
6 minimized, inactive window.
9 non-maximized window.
/Show(2)
method shows main window in minimized style.
"file"
File to open.
OpenCodepage
Open codepage. If -1 or not specified, it will be autodetected.
OpenBOM
File byte order mark. If -1 or not specified, it will be autodetected.
/OpenFile("C:\File.txt", 65001, -1)
method opens file in UTF-8 codepage.
"file"
Save current document to a specified file name.
SaveCodepage
Save codepage. If -1 or not specified, current codepage will be used.
SaveBOM
File byte order mark. 1 - exist, 0 - doesn't exist, -1 or not specified - current BOM will be used.
/SaveFile("C:\File.txt", 65001, 0)
method saves file in UTF-8 codepage without BOM.
/Command(4162)
method calls the internal command at number 4162.
/Call("Scripts::Main")
method calls Scripts plugin and Main function.
"command line"
Command line string.
"working directory"
Working directory string. Default is "".
Wait
Wait until the program finishes. 1 - wait, 0 - return immediately (default).
WindowStyle
See MainWindowStyle description of /Show() method. Note: programs could ignore this parameter.
/Exec("notepad.exe")
method calls notepad.
/Exec(`notepad.exe`)
method calls notepad.
/Exec('notepad.exe')
method calls notepad.
/Exec('%windir%\notepad.exe')
method calls notepad.
/Exec(`rundll32.exe shell32,ShellExec_RunDLL "%f"`, "%d")
method pass an active file for opening on Windows association.
"FaceName"
Font face, for example, "Courier". Unchanged, if "".
Style (one of the following):
0 ignored.
1 normal.
2 bold.
3 italic.
4 bold italic.
Size
Font size. Unchanged, if 0.
/Font("Courier", 4, 10)
method sets Courier bold italic font with 10 pt.
RecodeFrom
Codepage source. If -1, it will be auto-detected.
RecodeTo
Codepage target. If -1, it will be auto-detected.
/Recode(1252, 437)
method recodes the text from 1252 codepage to 437.
"text"
Text to insert.
Esc-sequences:
0 - "text" doesn't contain Esc-sequences (default).
1 - "text" contains Esc-sequences. A set of sequences similar to the find/replace dialog in the program, and also:
"\s" - replaced by the selected text of the editing window;
"\|" - set the caret position after text insertion.
/Insert("Some string")
method replaces selection with the specified text.
/Insert("<B>\s</B>", 1)
method enclose selection.
/Insert("\[0031 0032 0033]", 1)
method replaces selection with "123".
"expression"
Expression could consist of:
- mathematical operations:
+, -, *, /, %, &, |, ^.
- logical operations:
>, <, ==, !=, >=, <=, &&, ||, x?y:z.
- comments:
/*comment*/
- methods:
SendMain(nMessage, wParam, lParam)
nMessage
Specifies the message to be sent to the main window.
wParam
Specifies additional message-specific information.
lParam
Specifies additional message-specific information.
SendEdit(nMessage, wParam, lParam)
nMessage
Specifies the message to be sent to the current edit window.
wParam
Specifies additional message-specific information.
lParam
Specifies additional message-specific information.
Call("Plugin::Function"[, additional parameters])
- If a plugin is called, then exit code transfered via special parameter &nResult. &nResult must be located in a place where external call syntax requires a pointer to an integer.
/If(`Call("Coder::CodeFold", 1, &nResult)`, `/Call("Coder::CodeFold", 1)`, ``)
Close CodeFold window, if opened.
- If a script is called, then it is necessary to use external calls 2 or 4 and also transfer exit code from script via AkelPad.ScriptExitCode.
/If(`Call("Scripts::Main", 4, "EvalCmd.js", 'if (AkelPad.GetEditFile(0)) AkelPad.ScriptExitCode(1);')`, ``, `/Quit`)
Quit, if current document has no name.
- It is possible to call Scripts plugin method directly.
/If(`AkelPad.Constants._X64 == 1`, `/Quit`, ``)
Quit, if program is x64.
"IfTrue"
Command line, if expression result is true (not equal to zero).
"IfFalse"
Command line, if expression result is false (equal to zero).
/If(`SendMain(1222 /*AKD_GETMAININFO*/, 5 /*MI_SAVESETTINGS*/, 0) == 2 /*SS_INI*/`, `/OpenFile("%a\AkelPad.ini")`, ``)
method opens AkelPad.ini, if settings saved to ini file.
Flags to use variables for the following command line methods. Set by the sum of members:
0 don't expand variables.
1 expand system variables (for example, %windir%).
2 expand program variables %f,%d,%a. If flag set, then symbol % specified as %%.
By default: 1+2=3.
/Var(0) /OpenFile("1%a%2.txt")
open file "1%a%2.txt".
Variables available for use in methods:
|
CmdLineBegin | Specifies code to be added to the beginning of the command line before processing it.
Example: /C+ By default: "". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
CmdLineEnd | Specifies code to be added to the end of the command line before processing it.
Example: /Call("Scripts::Main", 1, "InsertDate.js", "") /C /B /L By default: "". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
ShowModify | Determines where document changed status will be displayed. Set by the sum of members:
By default: 1+8=9, show all: 1+2+4+8=15. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
StatusPosType | Defines how status bar statistics will be displayed. Set by the sum of members:
By default: 0. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
WordBreak | Defines how the caret on Ctrl+Left/Ctrl+Right will move. Works only if enabled "Word delimiters" in settings (WordDelimitersEnable=1). Set by the sum of members:
By default: 1+2+4+8+32+64=111 (AkelEdit), 1+8=9 (AkelPad). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
MouseOptions | Defines mouse settings. Set by the sum of members:
By default: 1+2+4=7. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
SingleOpenProgram | Option "Don't open a program twice" in MDI/PMDI mode. Set by the sum of members:
By default: 1. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
TabOptionsMDI | Defines tabs settings in MDI/PMDI mode. Set by the sum of members:
By default: 2+256+131072=131330. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
TabNameFind | Defines regular expression search pattern for tab name in MDI/PMDI mode. If pattern not found, file name displayed without changes. Used with TabNameRep.
By default: "". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
TabNameRep | Defines regular expression replace pattern for tab name in MDI/PMDI mode. Used with TabNameFind.
Example: TabNameFind=(.{20}).{3,}(?:\.([^.]*))? TabNameRep=\1...\2 By default: "". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
PaintOptions | Defines some text draw settings. Sets by the sum of members:
By default: 0. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
FixedCharWidth | Defines fixed character width. All symbols, including proportional fonts, will be paint in this width. Special values:
By default: 0. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
EditStyle | Defines some edit window creation flags. Sets by the sum of members:
By default: 0. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
RichEditClass | Defines edit control class name:
By default: 0. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AkelAdminResident | Defines residency of "AkelAdmin.exe":
By default: 1. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
StatusUserFormat | Defines user status bar format:
Example: "Symbol:0x%ch%[85]Font:%f%[48]Tab:%t%[38]Marker:%m%[60]Docs:%dm*/%dc" By default: "" - format is not defined, additional status bar section is not displayed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
DateInsertFormat | Defines insert date and time format.
Time:
Date:
Example: "H:mm:ss dd MMMM yyyy" -> "12:50:24 01 September 2010" By default: "" - program defined date and time format. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
DateLogFormat | Defines date and time format for files containing ".LOG" at the beginning. Works only if enabled "Insert date if file has .LOG at the beginning" in settings (DateLog=1). See DateInsertFormat for syntax description.
By default: "" - program defined date and time format. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
AkelUpdaterOptions | Defines command line options for the AkelUpdater.exe, when launched from "Help/Update..." menu item.
By default: "". |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
UrlCommand | Defines command for hyperlink click. Herewith variable %u denotes hyperlink text.
Example: Exec(`"%ProgramFiles%\Mozilla Firefox\firefox.exe" "%u"`) By default: "" - hyperlink opens by operating system. |
Ctrl+X Shift+Del |
Cut |
Ctrl+C Ctrl+Ins Ctrl+Shift+C |
Copy |
Ctrl+V Shift+Ins |
Paste |
Ctrl+Shift+V Ctrl+Shift+Ins |
Paste text as ANSI |
Alt+V | Paste to column selection |
Ctrl+A | Select all |
Backspace | Delete from left |
Del | Delete from right |
Ctrl+Z | Undo |
Ctrl+Shift+Z | Redo |
Insert | Insert/Overtype mode |
Home | Go to start of line |
End | Go to end of line |
Ctrl+Home | Go to start of text |
Ctrl+End | Go to end of text |
Ctrl+Left | Go to start of word |
Ctrl+Right | Go to end of word |
Ctrl+Up | Go to start of previous line |
Ctrl+Down | Go to start of next line |
Ctrl+PageUp | Go to first visible character |
Ctrl+PageDown | Go to last visible character |
Ctrl+Backspace | Delete left word |
Ctrl+Del | Delete right word |
Ctrl+N | Create new file |
Ctrl+Shift+N | Create new window |
Ctrl+O | Open file |
F5 Ctrl+Shift+O |
Reopen file |
F2 Ctrl+S |
Save |
Shift+F2 Ctrl+Shift+S |
Save as |
Ctrl+Alt+F2 | Save all |
Ctrl+Alt+F4 | Close all |
Ctrl+P | |
Esc Alt+F4 |
Exit |
Ctrl+F | Find |
F3 | Find next down. Search/replace dialog: close dialog and find next down. |
Shift+F3 | Find next up. Search/replace dialog: close dialog and find next up. |
Ctrl+R Ctrl+H |
Find and replace |
Ctrl+G | Go to line (by number) |
Ctrl+I | Run "Character map" (i.e. "Edit/Insert character" menu item) |
Ctrl+D | Insert date |
Ctrl+T | On/off "Always on top" |
Ctrl+U | On/off "Word wrap" |
Alt+W | Reopen file as ANSI (Windows) |
Alt+D | Reopen file as OEM (DOS) |
Alt+K | Reopen file as KOI8-R |
Alt+L | Reopen file as UTF-16LE |
Alt+B | Reopen file as UTF-16BE |
Alt+U | Reopen file as UTF-8 |
Shift+Alt+W | Save file as ANSI (Windows) |
Shift+Alt+D | Save file as OEM (DOS) |
Shift+Alt+K | Save file as KOI8-R |
Shift+Alt+L | Save file as UTF-16LE |
Shift+Alt+B | Save file as UTF-16BE |
Shift+Alt+U | Save file as UTF-8 |
Alt+F5 | Reopen file with code page detect |
F12 | Show context menu for fast reopening/saving in desired code page |
Alt+R | Recode text (i.e. "Edit/Selection/Recode..." menu item) |
Shift+Space | Delete space if several lines selected, otherwise insert space. |
Shift+Backspace | Delete first char |
Alt+Backspace | Trim trailing whitespace |
Alt+P | Plugins dialog |
Ctrl+F5 | Execute command |
Ctrl+L | On/off "Keep left spaces" |
Ctrl+Enter | Insert new line with keeping left spaces, if option "Keep space" is off.
Insert new line without keeping left spaces, if option "Keep space" is on. |
F4 Alt+Enter |
Maximize/restore window |
F8 Ctrl+Y |
Delete current line |
Alt+\ | Move caret to opposite end of selection |
Alt+, | Move caret to previous location |
Alt+. | Move caret to next location |
Ctrl+Num + | Increase font by 1 pt |
Ctrl+Num - | Decrease font by 1 pt |
Ctrl+Num * | Restore font to size at startup |
Ctrl+5 | Cycle selection through case change |
Ctrl+6 | Selected text, as "UPPERCASE" |
Ctrl+7 | Selected text, as "lowercase" |
Ctrl+8 | Selected text, as "Sentence case." |
Ctrl+9 | Selected text, as "Title Case" |
Ctrl+0 | Selected text, as "iNVERT cASE" |
F6 | Go to next dialog |
Shift+F6 | Go to previous dialog |
F9 | Activate next pane (split window) |
Shift+F9 | Activate previous pane (split window) |
F10 | Select window dialog (MDI/PMDI) |
Ctrl+Tab Ctrl+F6 |
Next window (MDI/PMDI) |
Ctrl+Shift+Tab Ctrl+Shift+F6 |
Previous window (MDI/PMDI) |
Ctrl+F4 Ctrl+W |
Close window (MDI/PMDI) |
4101 | Create new edit window |
4102 | Create new instance of program |
4103 | Open file dialog
Optional parameter: 1 - force to use last directory. |
4104 | Reopen file |
4105 | Save file |
4106 | Save file dialog
Optional parameter: 1 - force to use last directory. |
4107 | Print setup dialog |
4108 | Print dialog |
4109 | Exit program |
4110 | Save all documents |
4111 | Save all as dialog |
4113 | Print without dialog |
4114 | Print preview dialog |
4121 | Redetect code page of the current file |
4122 | Reopen file as ANSI |
4123 | Reopen file as OEM |
4124 | Reopen file as KOI-R |
4125 | Reopen file as UTF16LE |
4126 | Reopen file as UTF16BE |
4127 | Reopen file as UTF8 |
4131 | Save file as ANSI |
4132 | Save file as OEM |
4133 | Save file as KOI-R |
4134 | Save file as UTF16LE |
4135 | Save file as UTF16BE |
4136 | Save file as UTF8 |
4137 | Save file as UTF8 without BOM |
4140 | Show codepages context menu |
4151 | Undo last operation |
4152 | Redo last operation |
4153 | Cut
Optional first parameter: 1 - cut word under caret, if no selection; 2 - cut line under caret, if no selection; 4 - cut unwrapped line under caret, if no selection. 8 - cut also new line. Uses with flag 2 (2+8=10) or 4 (4+8=12). Optional second parameter: 1 - input new line. 2 - output new line (default). 3 - new line of the source (as is). 5 - "\r" new line. 6 - "\n" new line. 7 - "\r\n" new line. 8 - "\r\r\n" new line. Parameters value calculation: (first parameter value) + 100000 * (second parameter value) |
4154 | Copy
Optional first parameter: 1 - copy word under caret, if no selection; 2 - copy line under caret, if no selection; 4 - copy unwrapped line under caret, if no selection. 8 - copy also new line. Uses with flag 2 (2+8=10) or 4 (4+8=12). Optional second parameter: 1 - input new line. 2 - output new line (default). 3 - new line of the source (as is). 5 - "\r" new line. 6 - "\n" new line. 7 - "\r\n" new line. 8 - "\r\r\n" new line. Parameters value calculation: (first parameter value) + 100000 * (second parameter value) |
4155 | Paste
Optional first parameter: 1 - paste text as ANSI. Same as 4191 command. 2 - paste to column selection. Same as 4192 command. 4 - select pasted text. Optional second parameter: 1 - input new line (default). 2 - output new line. 3 - new line of the source (as is). 5 - "\r" new line. 6 - "\n" new line. 7 - "\r\n" new line. 8 - "\r\r\n" new line. Parameters value calculation: (first parameter value) + 100000 * (second parameter value) |
4156 | Delete |
4157 | Select all |
4158 | Find dialog |
4159 | Find last string down |
4160 | Find last string up |
4161 | Replace dialog |
4162 | Go to line dialog |
4163 | Run charmap.exe |
4164 | Insert tabulation |
4165 | Insert tabulation only if several lines selected |
4166 | Delete tabulation if several lines selected, otherwise insert tabulation.
Optional parameter: 1 - delete tabulation in single line selection. |
4167 | Delete tabulation only if several lines selected |
4168 | Insert space |
4169 | Insert space only if several lines selected |
4170 | Delete space if several lines selected, otherwise insert space.
Optional parameter: 1 - delete space in single line selection. |
4171 | Delete space only if several lines selected |
4172 | Delete first char |
4173 | Delete first char only if selection not empty |
4174 | Delete trailing whitespaces |
4175 | Convert text to "UPPERCASE".
Optional parameter: 1 - change case for all text if no selection. |
4176 | Convert text to "lowercase".
Optional parameter: 1 - change case for all text if no selection. |
4177 | Convert text to "Sentence case.".
Optional parameter: 1 - change case for all text if no selection. |
4178 | Convert text to "Title Case".
Optional parameter: 1 - change case for all text if no selection. |
4179 | Convert text to "iNVERT cASE".
Optional parameter: 1 - change case for all text if no selection. |
4180 | Cycle case.
Optional parameter: 1 - change case for all text if no selection. |
4182 | Recode dialog |
4183 | Insert date |
4184 | Windows newline format |
4185 | Unix newline format |
4186 | Mac newline format |
4190 | Insert/Overtype mode |
4191 | Paste as ANSI text |
4192 | Paste to column selection |
4193 | Paste text after caret |
4194 | Paste text taking into account selection case |
4195 | Delete all whitespaces in selection |
4196 | Insert new line with keeping left spaces, if option "Keep space" is off.
Insert new line without keeping left spaces, if option "Keep space" is on. |
4197 | Delete current line.
Optional parameter: 1 - delete all wrapped line. |
4198 | Move caret to opposite end of selection |
4199 | Move caret to previous location |
4200 | Move caret to next location |
4201 | Font dialog |
4202 | Color theme dialog |
4204 | Increase font 1pt |
4205 | Decrease font 1pt |
4206 | Restore font to size at startup |
4209 | Word wrap (on\off) |
4210 | Always on top (on\off) |
4211 | Show status bar (on\off) |
4212 | Split window into four panes |
4213 | Split window into two vertical panes |
4214 | Split window into two horizontal panes |
4215 | Split window (on\off) |
4216 | Read only (on\off) |
4251 | Execute command |
4252 | Save file time (on\off) |
4253 | Watch file change (on\off) |
4254 | Keep left spaces (on\off) |
4255 | Single open file (on\off) |
4256 | Single open program (on\off) |
4259 | Plugins dialog |
4260 | Options dialog |
4261 | SDI mode |
4262 | MDI mode |
4263 | Pseudo MDI mode |
4301 | Tab list window at the top of the main window |
4302 | Tab list window at the bottom of the main window |
4303 | Hide tab list |
4304 | Standard tab list style |
4305 | Buttons tab list style |
4306 | Flat buttons tab list style |
4307 | MDI windows - horizontal tile |
4308 | MDI windows - vertical tile |
4309 | MDI windows - cascade |
4310 | Switch tabs: next-previous. |
4311 | Switch tabs: right-left. |
4316 | Activate next tab |
4317 | Activate previous tab |
4318 | Close current tab |
4319 | Close all tabs |
4320 | Close all tabs but active |
4321 | Close all unmodified tabs
Optional parameter: 1 - close all modified tabs. |
4322 | Clone current tab |
4323 | Copy current tab file path
Optional parameter: 0 - copy full path (default); 1 - copy directory; 2 - copy file name; 3 - copy file base name; 4 - copy file extension. |
4324 | Close file |
4325 | Close file and exit program (SDI) or close tab of a file (MDI/PMDI). |
4327 | Select window dialog (MDI/PMDI). Same as 10019. |
4331 | Restore/Maximize main window |
4332 | Activate next dialog window |
4333 | Activate previous dialog window |
4341 | Activate next pane (split window) |
4342 | Activate previous pane (split window) |
4351 | About dialog |
4352 | Open user's manual (this file) |
4353 | Check updates (AkelUpdater), uses AkelUpdaterOptions string |
5001 | Delete dead recent files from "Recent files" list |
5001 + n | Open recent file n |
6001 | Activate internal language |
6001 + n | Activate language n |
7001 | Reopen file in first codepage of codepage list |
7001 + n | Reopen file in codepage n of codepage list |
8001 | Save file in first codepage of codepage list |
8001 + n | Save file in codepage n of codepage list |
10019 | Select window dialog (MDI/PMDI). Same as 4327. |
Expression example | Matches |
---|---|
^\s*?$ | Match a blank line. |
\d{2}-\d{5} | Validate an ID number consisting of 2 digits, a hyphen, and an additional 5 digits. |
<(\w+)[^>]*>.*?</\1> | Match an HTML tag. |
Character | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
\ | Marks the next character as a literal (one of "()[]{}^$.?+*\|"), a special character or a backreference. For example, 'n' matches the character "n". '\n' matches a newline character. The sequence '\\' matches "\" and '\(' matches "(". | ||||||||||||||||
^ | Matches the position at the beginning of the line. | ||||||||||||||||
$ | Matches the position at the end of the line. | ||||||||||||||||
* | Matches the preceding character or subexpression zero or more times. For example, 'zo*' matches "z" and "zoo". '*' is equivalent to '{0,}'. | ||||||||||||||||
+ | Matches the preceding character or subexpression one or more times. For example, 'zo+' matches "zo" and "zoo", but not "z". '+' is equivalent to '{1,}'. | ||||||||||||||||
? | Matches the preceding character or subexpression zero or one time. For example, 'do(es)?' matches the "do" in "document" or "does" in "does". '?' is equivalent to '{0,1}'. | ||||||||||||||||
{n} | n is a nonnegative integer. Matches exactly n times. For example, 'o{2}' does not match the "o" in "Bob", but matches the two o's in "food". | ||||||||||||||||
{n,} | n is a nonnegative integer. Matches at least n times. For example, 'o{2,}' does not match the "o" in "Bob" and matches all the o's in "foooood". 'o{1,}' is equivalent to 'o+'. 'o{0,}' is equivalent to 'o*'. | ||||||||||||||||
{n,m} | M and n are nonnegative integers, where n <= m. Matches at least n and at most m times. For example, "o{1,3}" matches the first three o's in "fooooood". 'o{0,1}' is equivalent to 'o?'. Note that you cannot put a space between the comma and the numbers. | ||||||||||||||||
. | (dot or period) Matches any single character. | ||||||||||||||||
(pattern) | A subexpression that matches pattern and captures the match. The captured match can be retrieved from the resulting collection using the \0...\9 backreferences. To match parentheses characters "(" or ")", use '\(' or '\)'. | ||||||||||||||||
(?^pattern) | A subexpression that matches negative pattern and captures the match. Pattern must be of fixed length, but could contain backreferences. | ||||||||||||||||
(?:pattern) | A subexpression that matches pattern but does not capture the match, that is, it is a non-capturing match that is not stored for possible later use. This is useful for combining parts of a pattern with the "or" character (|). For example, 'industr(?:y|ies)' is a more economical expression than 'industry|industries'. | ||||||||||||||||
(?=pattern) | A subexpression that performs a positive lookahead search, which matches the search string at any point where a string matching pattern begins. This is a non-capturing match, that is, the match is not captured for possible later use. For example, 'Windows (?=95|98|NT|2000)' matches "Windows" in "Windows 2000" but not "Windows" in "Windows 3.1". Lookaheads do not consume characters, that is, after a match occurs, the search for the next match begins immediately following the last match, not after the characters that comprised the lookahead. | ||||||||||||||||
(?!pattern) | A subexpression that performs a negative lookahead search, which matches the search string at any point where a string not matching pattern begins. This is a non-capturing match, that is, the match is not captured for possible later use. For example, 'Windows (?!95|98|NT|2000)' matches "Windows" in "Windows 3.1" but does not match "Windows" in "Windows 2000". Lookaheads do not consume characters, that is, after a match occurs, the search for the next match begins immediately following the last match, not after the characters that comprised the lookahead. | ||||||||||||||||
(?<=pattern) | A subexpression that performs a positive lookbehind search, which matches the search string at any point where a string matching pattern ends. For example, '(?<=abc)z' matches an "z" only if it is preceded by the expression "abc". This is a non-capturing match, that is, the match is not captured for possible later use. Pattern must be of fixed length. | ||||||||||||||||
(?<!pattern) | A subexpression that performs a negative lookbehind search, which matches the search string at any point where a string not matching pattern ends. For example, '(?<!abc)z' matches an "z" only if it is not preceded by the expression "abc". This is a non-capturing match, that is, the match is not captured for possible later use. Pattern must be of fixed length. | ||||||||||||||||
(?>pattern) | Atomic subexpression. Backtracking in this pattern is denied, if part of the pattern already found. For example, 'a(?>bc|b)c' matches an "abcc", but not "abc". This is a non-capturing match, that is, the match is not captured for possible later use. | ||||||||||||||||
(?(condition)pattern-true|pattern-false)
(?(condition)pattern-true) |
If the condition is satisfied, the pattern-true is used; otherwise the pattern-false (if present) is used. Condition can be pattern with positive/negative lookahead/lookbehind search or a number of backreference, which will be checked for match success. For example, '(a)?b(?(1)c|d)' matches the "abc" in "abc" and "bd" in "zbd". Because, if "a" found, then trying to find "c" after "b", if "a" not found, then trying to find "d" after "b". | ||||||||||||||||
(?options) |
Options applies only to current group, if specified at the beginning of a special pattern, for example, 'a(?i:b)c' applies to "b" or also to the next groups, if specified separately, for example, 'a(?i)bc' applies to "bc".
Possible to use several options at once, for example, 'a(?im-Us)bc'.
|
||||||||||||||||
x|y | Matches either x or y. For example, 'z|food' matches "z" or "food". '(z|f)ood' matches "zood" or "food". | ||||||||||||||||
[xyz] | A character set. Matches any one of the enclosed characters. For example, '[abc]' matches the "a" in "plain". | ||||||||||||||||
[^xyz] | A negative character set. Matches any character not enclosed. For example, '[^abc]' matches the "p" in "plain". | ||||||||||||||||
[a-z] | A range of characters. Matches any character in the specified range. For example, '[a-z]' matches any lowercase alphabetic character in the range "a" through "z". | ||||||||||||||||
[^a-z] | A negative range characters. Matches any character not in the specified range. For example, '[^a-z]' matches any character not in the range "a" through "z". | ||||||||||||||||
\b | Matches a word boundary, that is, the position between a word and a delimiter. For example, 'er\b' matches the "er" in "never" but not the "er" in "verb". | ||||||||||||||||
\B | Matches a non-word boundary. 'er\B' matches the "e" in "verb" but not the "er" in "never". | ||||||||||||||||
\A | Matches the position at the beginning of the document. For example, '\Aabc' matches the "abc" in "abc\ndef" but not the "abc" in "def\nabc". | ||||||||||||||||
\Z | Matches the position at the end of the document. For example, 'abc\Z' matches the "abc" in "def\nabc" but not the "abc" in "abc\ndef". | ||||||||||||||||
\a | Same as \A, but matches the position at the beginning of the search range. | ||||||||||||||||
\z | Same as \Z, but matches the position at the end of the search range. | ||||||||||||||||
\K | Any previously matched characters not included in the final result. For example, 'a+b+\K\c+' matches the "ccc" in "aaabbbccc". | ||||||||||||||||
\d | Matches a digit character. Equivalent to '[0-9]'. | ||||||||||||||||
\D | Matches a non-digit character. Equivalent to '[^0-9]'. | ||||||||||||||||
\f | Matches a form-feed character. Equivalent to '\x0c'. | ||||||||||||||||
\n | Matches any newline. To match Unix newline character use '\x0a'. | ||||||||||||||||
\r | Matches any newline. To match Mac newline character use '\x0d'. | ||||||||||||||||
\s | Matches any whitespace character including space, tab, form-feed, and so on. Equivalent to '[ \f\n\r\t\v]'. | ||||||||||||||||
\S | Matches any non-whitespace character. Equivalent to '[^ \f\n\r\t\v]'. | ||||||||||||||||
\t | Matches a tab character. Equivalent to '\x09'. | ||||||||||||||||
\v | Matches a vertical tab character. Equivalent to '\x0b'. | ||||||||||||||||
\w | Matches any word character (any character excluding delimiter). | ||||||||||||||||
\W | Matches any non-word character (any delimiter). | ||||||||||||||||
\xn | Matches n, where n is a hexadecimal escape value with exactly two digits long. For example, '\x41' matches "A". | ||||||||||||||||
\un | Matches n, where n is a Unicode character expressed as four hexadecimal digits. For example, '\u00A9' matches the copyright symbol "©". | ||||||||||||||||
\x{n} | Matches n, where n is a hexadecimal escape value. For example, '\x{20027}' is equal to surrogate pair '\uD840\uDC27'. | ||||||||||||||||
\n | Matches n, where n is a single decimal digit - a reference back to captured matches. For example, '(.)\1' matches two consecutive identical characters. | ||||||||||||||||
\nn | Matches nn, where nn is a two digit decimal number from 01 through 99 - a reference back to captured matches. For example, '(.)\01' matches two consecutive identical characters. |