Top: Index Previous: Collections Up: Java Programming

CSC8311 -- Advanced Object-Orientated Programming

Regular Expressions

While it's not as true about bioinformatics as it was in the past, you will spent a reasonable amount of time searching, sorting and hacking text. It's one of the reasons that Perl is still common in bioinformatics; in particular it has support for regular expressions built into the langauge. Java lacked any support for regexp's for a long time, but now fortunately has a good library. In Java, this operates over strings or, indeed, a CharSequence. Some of you will have discovered this last semester; the "search for a Shine Delgarno sequence" part of CSC8303 can be achieved in one line of code.

You will find regexps occuring in many languages; just to make our lives easier, all the language developers in the world decided to get together to ensure that each language uses a slightly different syntax and a slightly different semantics. So you need to be used to reading and understanding what the various characters means and reading the documentation.

Now please, try the regexp trail and attempt the exercises.


Top: Index Previous: Collections Up: Java Programming