ToDo X provides two ways to rename a group of categories or to-do items without laboriously editing each one individually.
The easy way is through the use of the Prefix command, which allows you to add or remove a name prefix. First, in the Categories or Things To Do list select the names that you want to change; then choose Prefix… from the Edit menu. In the Prefix panel, enter your prefix into the text box or choose it from the drop-down menu. Click the Add button to add that prefix to every selected name, or the Remove button to remove that prefix from every name where it is present.
If the change you want to make is more complicated than just adding or removing a prefix, then you may have to resort to the not-so-easy way, using the hidden Rename command. Be aware that this requires knowledge of regular expressions, carries the risk of horrible mistakes, and is not undoable. Therefore, it is recommended that you back up your data before trying it. Having done so, proceed as follows.
First, in the Categories or Things To Do list select the names that you want to change; then hold down the option key and choose Rename… from the Edit menu. (The command is normally hidden and appears in place of Prefix… when the option key is down.) In the Rename panel, enter your Find and Replace strings in the text boxes or choose them from the drop-down menus. Click the Find button to find the matching names, or the Replace button to rename them.
If you enter something simple in the Find box (say ABC) and the Replace box (say XXXXX) and click the Replace button, this will change every occurrence of ABC to XXXXX in every selected name. So, for example, “The ABC’s of ABCDE” would become “The XXXXX’s of XXXXXDE”.
However, what you enter in the Find box is treated not as a simple text string, but as a so-called regular expression allowing the use of a variety of special characters to perform sophisticated pattern matching. Dollar signs, parentheses, question marks and backslashes (“\”) are among the characters that have special meaning in a regular expression.
Furthermore, what you enter in the Replace box is also not treated as a simple text string. It may contain references (of the form “$n”) to whatever the Find expression matched, and/or pieces thereof.
A full explanation of regular expressions and replacement strings is beyond the scope of this document, but you can find any number of web pages and books that tackle the subject. You will need to know that the specific regular expression language used in ToDo X is the one implemented by the open-source project RegexKitLite and the ICU library. A summary of the regular expression syntax used in ToDo X is provided here for your convenience. See the provided links for definitive information, as they are the sources from which these tables were derived.
\a | Match a BELL, \u0007. |
\A | Match at the beginning of the input. Differs from ^ in that \A will not match after a line terminator within the input. |
\b, outside [Set] | Match if the current position is a word boundary. Boundaries occur at the transitions between word \w and non-word \W characters, with combining marks ignored. |
\b, within [Set] | Match a BACKSPACE, \u0008. |
\B | Match if the current position is not a word boundary. |
\cx | Match a Control-x character. |
\d | Match any character with the Unicode General Category of Nd (Number, Decimal Digit). |
\D | Match any character that is not a decimal digit. |
\e | Match an ESCAPE, \u001B. |
\E | Terminates a \Q…\E quoted sequence. |
\f | Match a FORM FEED, \u000C. |
\G | Match if the current position is at the end of the previous match. |
\n | Match a LINE FEED, \u000A. |
\N{Unicode Character Name} | Match the named Unicode Character. |
\p{Unicode Property Name} | Match any character with the specified Unicode Property. |
\P{Unicode Property Name} | Match any character not having the specified Unicode Property. |
\Q | Quotes all following characters until \E. |
\r | Match a CARRIAGE RETURN, \u000D. |
\s | Match a white space character. White space is defined as [\t\n\f\r\p{Z}]. |
\S | Match a non-white space character. |
\t | Match a HORIZONTAL TABULATION, \u0009. |
\uhhhh | Match the character with the hex value hhhh. |
\Uhhhhhhhh | Match the character with the hex value hhhhhhhh. |
\w | Match a word character. Word characters are [\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}]. |
\W | Match a non-word character. |
\x{h…} | Match the character with hex value hhhh. From one to six hex digits may be supplied. |
\xhh | Match the character with the hex value hh. |
\X | Match a Grapheme Cluster. |
\Z | Match if the current position is at the end of input, but before the final line terminator if present. |
\z | Match if the current position is at the end of input. |
\n | Back Reference. Match whatever the nth capturing group matched. n must be a number ≥ 1 and ≤ total number of capture groups in the pattern. Note: Octal escapes, such as \012, are not supported. |
[pattern] | Match any one character from the set. |
. | Match any character. |
^ | Match at the beginning of a line. |
$ | Match at the end of a line. |
\ | Quotes the following character. Characters that must be quoted to be treated as literals are * ? + [ ( ) { } ^ $ | \ . / |
| | Alternation. A|B matches either A or B. |
* | Match zero or more times. Match as many times as possible. |
+ | Match one or more times. Match as many times as possible. |
? | Match zero or one times. Prefer one. |
{n} | Match exactly n times. |
{n,} | Match at least n times. Match as many times as possible. |
{n,m} | Match between n and m times. Match as many times as possible, but not more than m. |
*? | Match zero or more times. Match as few times as possible. |
+? | Match one or more times. Match as few times as possible. |
?? | Match zero or one times. Prefer zero. |
{n}? | Match exactly n times. |
{n,}? | Match at least n times, but no more than required for an overall pattern match. |
{n,m}? | Match between n and m times. Match as few times as possible, but not less than n. |
*+ | Match zero or more times. Match as many times as possible when first encountered, do not retry with fewer even if overall match fails. Possessive match. |
++ | Match one or more times. Possessive match. |
?+ | Match zero or one times. Possessive match. |
{n}+ | Match exactly n times. Possessive match. |
{n,}+ | Match at least n times. Possessive match. |
{n,m}+ | Match between n and m times. Possessive match. |
(…) | Capturing parentheses. Range of input that matched the parenthesized subexpression is available after the match. |
(?:…) | Non-capturing parentheses. Groups the included pattern, but does not provide capturing of matching text. |
(?>…) | Atomic-match parentheses. First match of the parenthesized subexpression is the only one tried; if it does not lead to an overall pattern match, back up the search for a match to a position before the (?> . |
(?#…) | Free-format comment (?#comment). |
(?=…) | Look-ahead assertion. True if the parenthesized pattern matches at the current input position, but does not advance the input position. |
(?!…) | Negative look-ahead assertion. True if the parenthesized pattern does not match at the current input position. Does not advance the input position. |
(?<=…) | Look-behind assertion. True if the parenthesized pattern matches text preceding the current input position, with the last character of the match being the input character just before the current position. Does not alter the input position. The length of possible strings matched by the look-behind pattern must not be unbounded (no * or + operators). |
(?<!…) | Negative Look-behind assertion. True if the parenthesized pattern does not match text preceding the current input position, with the last character of the match being the input character just before the current position. Does not alter the input position. The length of possible strings matched by the look-behind pattern must not be unbounded (no * or + operators). |
(?ismwx-ismwx:…) | Flag settings. Evaluate the parenthesized expression with the specified flags enabled or -disabled. |
(?ismwx-ismwx) | Change the flag settings. Changes apply to the portion of the pattern following the setting. For example, (?i) changes to a case insensitive match. |
(?i) | Case-insensitive matching. |
(?s) | A “.” in a pattern will match a line terminator in the input text. |
(?m) | By default, “^” and “$” will only match at the start and end, respectively, of the input text. If the m flag is set, they will also match at the start and end of each line within the input text. |
(?w) | By default, “\b” word boundaries are identified by a simple classification of characters as either word or non-word. If the w flag is set, word boundaries are found according to the Unicode notion of Text Boundaries. |
(?x) | White space and #comments are allowed within patterns. |
$0 | The entirety of the matched text will be substituted for $0. |
$1…$n | The text of capture group i will be substituted for $i. The operation will fail if i exceeds the number of capture groups. A $ not followed by a digit has no special meaning, and will appear in the substitution text as a $. |
\ | Treat the character following the backslash as a literal, suppressing any special meaning. Backslash escaping in substitution text is required only for $ and \, but may precede any character. The backslash itself will not be copied to the substitution text. |