AkelPad 4 - User's Manual

Contents:

  1. Compatibility
  2. General remarks
  3. Features
  4. Command line parameters
  5. Manual settings
  6. Keyboard commands
  7. Internal commands
  8. Regular expression syntax
  9. License
  10. Contributors

Compatibility

Program is intended to work under Windows 95/98/Me and Windows NT 4.0/2000/XP/2003/Vista/Seven.

General remarks

Notepad is a wonderful editor, being used to edit files in plain text format, thus it is irreplaceable for programming, designing of Web documents, and so on. However, the one comprised in Windows, is very inconvenient due to several limitations. This program claims to be able to fill up these drawbacks.
Note: this program takes a lot of advantages from Unicode representation. It is strongly recommended that you set up TrueType font (as Courier New) to gain more advantages from this feature.

Features

Brief description of general features:

Command line parameters

AkelPad.exe [parameters] "file1.ext" [parameters] "file2.ext" [parameters] ...

Manual settings

Settings are saved in AkelPad.ini or in registry (HKEY_CURRENT_USER\Software\Akelsoft\AkelPad), depending on options.

Keyboard commands

Internal commands

Can be used in command line method /Command() and also in ContextMenu, ToolBar, Hotkeys, Scripts plugins.

Regular expression syntax

A regular expression is a pattern of text that consists of ordinary characters (for example, letters a through z) and special characters, known as metacharacters. The pattern describes one or more strings to match when searching text.

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.


The following table contains the complete list of metacharacters and their behavior in the context of regular expressions:

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 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 "а" found, then trying to find "с" after "b", if "а" not found, then trying to find "d" after "b".
(?options) Options applies to the current group, if specified at the beginning of a special pattern, for example, 'a(?i:b)c' applies to "b" or to the next group, if specified separately, for example, 'a(?i)bc' applies to "bc".
Possible to use several options at once, for example, 'a(?im-Us)bc'.

(?i) case insensitive.
(?m) multiline search (default).
(?s) dot '.' matches any single character (default).
(?U) invert greediness.
(?-i) match case.
(?-m) turn off multiline search. '^' matches document beginning and '$' matches document end.
(?-s) dot '.' matches any single character, except newline character.
(?-U) turn off greediness inversion.
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.
\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.

Notes:
- Regular expression quantifiers (*, +, {n,}) are greedy by default (except for single dot, like, ".*" or ".{5,10}"). To make it non-greedy (old behaviour) use "?" after quantifier, like, "\d*?".
- AkelPad's regular expressions greediness works consequentially (atomically). For example, pattern "ab?b" in "abc" has no matches, because "ab?" matches "ab" and next "b" has no match. Correct pattern will be "abb?".

License

This program is distributed under "BSD license" conditions. BSD license is open source license approved by OSI. It can be found on their site.

Contributors

Shengalts Aleksander (e-mail: shengalts@mail.ru)
Kuznetsov Alexey

Home page: http://akelpad.sf.net