Regular Expressions

2015-03-11

azim58 - Regular Expressions
regex portal

Regular Expressions
regex

Tools
Java
regexr
http://www.gskinner.com/RegExr/

Tips
\1,\2, . . backslash and a number can be used to refer back to a group
used previously in a regular expression
$1, $2, .. dollar sign and a number can call back the groups when
replacing text
(?i) . .case insensitive match in Java (?i) see
(http://stackoverflow.com/questions/5568081/regex-replace-all-ignore-case)

see also
How to find and replace regular expressions with groups in java
How to match everything except a certain group with regular expressions



list of things you can do with regular expressions
list of uses for regular expressions


Instances of regular expressions I've used
5-6-13 regular expression to replace all lines that don't have a q1q
at the end
3-14-13 regex to replace multiple spaces numbers and new lines with
nothing
3-19-13 regex to replace multiple space characters with a tab
3-5-13d1351 regex to match y or fewer of something
3-5-13d1140 regex to reformat a hyphenated heirarchical list into Java
like code so that it can be viewed in an IDE
3-5-13d1100 regex to match an exact number of something
2-26-13 regex to reformat fasta format into tab separated columns
2-15-13 how to match white space but not a new line
2-14-13 trouble matching new lines with regular expressions
2-10-13
find a sequence that may be gapped with other characters
regex to reformat tab separated columns into fasta format 2-2-13
regex 1-19-13