flauxtext is the first text editor which allows you to both search using regular expressions and replace using some of the same escape characters. this allows you to search and replace around linebreaks, which no other text editor can do. it is consequently the first to combine this handy function with dozens more, including multiple extensive text configuration files, tabs, the ability to pass arguments [eg. the current filename] to other programs, multiple copy-paste, gtk themes, email, ftp, http, cvs, over 20 builtin ways to quickly modify selected/all text, and much more. in the Find dialog, checking the checkbox next to the "replace with" entry box causes flauxtext to replace all instances of the following strings with other characters by the following rubric. [the left column is what you put in the "replace with" entry box; the right column describes the character flauxtext interprets it as.] \n newline \r carriage return \t horizontal tab the re.I, re.M, re.S, re.L checkbuttons indicate whether to use the I, M, S, and/or L regular expression options. I ignore case ['abc' is the same as 'ABC'] M multiline ['^' matches the start of a line, and '$' matches the end of a line S dot all ['.' matches newline ['\n'] in addition to every other character] L locale [\w and \b may be different depending on your LOCALE] flauxtext also searches using regular expressions if you check the checkbox next to the "find" text entry widget. a very brief reference on regular expressions: special characters: | "or"; use to specify alternatives * greedy; indicates that the preceding character may be matched any number of times, including zero ["m*" matches "", "m", "mmmmmmmm", etc.] + similar to '*', but indicates that the preceding character must be present at least once in order for a match to occur ["fre+" matches "freee" but not "fr"] ? indicates that the preceding character may be matched zero times or one time ["colou?r" matches "color" and "colour"] ( ) indicates groups ["gr(e|a)y" matches "grey" and "gray"] [ ] indicates a different sort of grouping ["gr[eaou]y" is the same as "gr(e|a|o|u)y"] [^ ] indicates a complementing set ["[^1234]" matches any character that is not one of "1", "2", "3", or "4"] \ indicates that the following character is special; if it precedes another special character, that special character is interpreted literally ["\\" matches a literal backslash, "\." matches a literal period] . matches any single character [except newline, unless re.S is checked] [".at" matches "cat", "hat", and "mat", but not "chat" or "frat"] - [dash] implies a continuous set ["[a-z]" matches any lowercase letter] ^ matches the start of everything $ matches the end of everything \number Matches the contents of the group of the same number. \A Matches only at the start of the string. \Z Matches only at the end of the string. \b Matches the empty string, but only at the start or end of a word. \B Matches the empty string, but not at the start or end of a word. \\ Matches a literal backslash. \w [a-zA-Z0-9] \W [^\w] \t horizontal tab \n newline \r carriage return \v vertical tab \s [\n\r\t\v ] \S [^\s] \d [0-9] \D [^\d] [set]{x,y} matches any char in set at least x, and at most y, times (?iLmsux) Set the ignorecase, Locale [make \w, \b depend on location], Multiline [make ^ and $ match beginning and end of lines], S [make . match any char including newline], Unicode [make \w, \b depend on unicode location], or X [verbose; ignore whitespace and comments] flag for the regular expression pattern NOTE: the checkboxes in the Find dialog labeled re.I, re.L, ... correspond to these flags. so, beginning your pattern with "(?i)" is exactly the same as checking the re.I checkbox (?:...) Non-grouping version of regular parentheses. (?P...) The substring matched by the group is accessible by name. [this is unusable in flauxtext.] (?P=name) Matches the text matched earlier by the group named name. (?#...) A comment; ignored. (?=...) Matches if ... matches next, but doesn't consume the string. (?!...) Matches if ... doesn't match next. for more information on regular expressions [particularly for python] go to "Tools>Python help(module)" and type "sre" (without the quotes ;-). wikipedia has a decent page on regular expressions: http://en.wikipedia.org/wiki/Regexp to replace all occurances of a name [any string matching '\w[\w\d]*'], replace "(?![\w\d])oldname(?![\w\d])" with "newname". for further reference, when you list-sort the characters in string.printable, you get this string: '\t\n\x0b\x0c\r !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~' which is the same as ''.join([chr(i) for i in range(9,14)+range(32,127)]) and for your python programming reference [and mine :-], _sre.SRE_Match objects support the following methods and properties. expand(template) Return the string obtained by doing backslash substitution on the template string template, as done by the sub() method. Escapes such as "\n" are converted to the appropriate characters, and numeric backreferences ("\1", "\2") and named backreferences ("\g<1>", "\g") are replaced by the contents of the corresponding group. group([group1, ...]) Returns one or more subgroups of the match. If there is a single argument, the result is a single string; if there are multiple arguments, the result is a tuple with one item per argument. Without arguments, group1 defaults to zero (the whole match is returned). If a groupN argument is zero, the corresponding return value is the entire matching string; if it is in the inclusive range [1..99], it is the string matching the corresponding parenthesized group. If a group number is negative or larger than the number of groups defined in the pattern, an IndexError exception is raised. If a group is contained in a part of the pattern that did not match, the corresponding result is None. If a group is contained in a part of the pattern that matched multiple times, the last match is returned. If the regular expression uses the (?P...) syntax, the groupN arguments may also be strings identifying groups by their group name. If a string argument is not used as a group name in the pattern, an IndexError exception is raised. A moderately complicated example: m = re.match(r"(?P\d+)\.(\d*)", '3.14') After performing this match, m.group(1) is '3', as is m.group('int'), and m.group(2) is '14'. groups([default]) Return a tuple containing all the subgroups of the match, from 1 up to however many groups are in the pattern. The default argument is used for groups that did not participate in the match; it defaults to None. (Incompatibility note: in the original Python 1.5 release, if the tuple was one element long, a string would be returned instead. In later versions (from 1.5.1 on), a singleton tuple is returned in such cases.) groupdict([default]) Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name. The default argument is used for groups that did not participate in the match; it defaults to None. start([group]) end([group]) Return the indices of the start and end of the substring matched by group; group defaults to zero (meaning the whole matched substring). Return -1 if group exists but did not contribute to the match. For a match object m, and a group g that did contribute to the match, the substring matched by group g (equivalent to m.group(g)) is m.string[m.start(g):m.end(g)] Note that m.start(group) will equal m.end(group) if group matched a null string. For example, after m = re.search('b(c?)', 'cba'), m.start(0) is 1, m.end(0) is 2, m.start(1) and m.end(1) are both 2, and m.start(2) raises an IndexError exception. span([group]) For MatchObject m, return the 2-tuple (m.start(group), m.end(group)). Note that if group did not contribute to the match, this is (-1, -1). Again, group defaults to zero. pos The value of pos which was passed to the search() or match() method of the RegexObject. This is the index into the string at which the RE engine started looking for a match. endpos The value of endpos which was passed to the search() or match() method of the RegexObject. This is the index into the string beyond which the RE engine will not go. lastindex The integer index of the last matched capturing group, or None if no group was matched at all. For example, the expressions (a)b, ((a)(b)), and ((ab)) will have lastindex == 1 if applied to the string 'ab', while the expression (a)(b) will have lastindex == 2, if applied to the same string. lastgroup The name of the last matched capturing group, or None if the group didn't have a name, or if no group was matched at all. re The regular expression object whose match() or search() method produced this MatchObject instance. string The string passed to match() or search().