Mercurial > repos > bgruening > text_processing
diff find_and_replace.xml @ 7:d64eace4f9f3 draft
Uploaded
| author | bgruening |
|---|---|
| date | Sat, 17 Jan 2015 08:30:15 -0500 |
| parents | 8928e6d1e7ba |
| children | c78b1767db2b |
line wrap: on
line diff
--- a/find_and_replace.xml Thu Jan 08 09:07:31 2015 -0500 +++ b/find_and_replace.xml Sat Jan 17 08:30:15 2015 -0500 @@ -21,7 +21,7 @@ </command> <inputs> <param name="infile" format="txt" type="data" label="File to process" /> - <param name="find_pattern" type="text" size="20" label="Find pattern" help="Use simple text, or a valid regular expression (without backslashes // ) " > + <param name="find_pattern" type="text" size="20" label="Find pattern" help="Use simple text, or a valid regular expression (without backslashes // ) " > <sanitizer> <valid initial="string.printable"> <remove value="'"/> @@ -135,7 +135,7 @@ **Example 2** -**Find Pattern:** ^chr +**Find Pattern:** ^chr **Replace Pattern:** (empty) **Regular Expression:** yes **Replace what:** column 11 @@ -147,7 +147,7 @@ **Perl's Regular Expression Syntax** -The Find & Replace tool searches the data for lines containing or not containing a match to the given pattern. A Regular Expression is a pattern descibing a certain amount of text. +The Find & Replace tool searches the data for lines containing or not containing a match to the given pattern. A Regular Expression is a pattern descibing a certain amount of text. - **( ) { } [ ] . * ? + \\ ^ $** are all special characters. **\\** can be used to "escape" a special character, allowing that special character to be searched for. - **^** matches the beginning of a string(but not an internal line). @@ -155,8 +155,8 @@ - **{** n or n, or n,m **}** specifies an expected number of repetitions of the preceding pattern. - **{n}** The preceding item is matched exactly n times. - - **{n,}** The preceding item ismatched n or more times. - - **{n,m}** The preceding item is matched at least n times but not more than m times. + - **{n,}** The preceding item ismatched n or more times. + - **{n,m}** The preceding item is matched at least n times but not more than m times. - **[** ... **]** creates a character class. Within the brackets, single characters can be placed. A dash (-) may be used to indicate a range such as **a-z**. - **.** Matches any single character except a newline. @@ -164,10 +164,10 @@ - **?** The preceding item is optional and matched at most once. - **+** The preceding item will be matched one or more times. - **^** has two meaning: - - matches the beginning of a line or string. + - matches the beginning of a line or string. - indicates negation in a character class. For example, [^...] matches every character except the ones inside brackets. - **$** matches the end of a line or string. -- **\\|** Separates alternate possibilities. +- **\\|** Separates alternate possibilities. - **\\d** matches a single digit - **\\w** matches a single letter or digit or an underscore. - **\\s** matches a single white-space (space or tabs).
