/Regular expressions/ are a very powerful tool to do all kinds of cool tricks with text and are particularly useful to validate input.

We will give a short introduction on this topic.

There a quite some ways (syntaxes) to write your regular expressions, some more readable than others.
As popularity of integration in programming toolkits goes, the variant that is know as perl regex is found in most languages, like perl (duh) , javascript, java, .NET and many more as a library or package as part of the runtime.

1. Study material

slides on regex.

1.1. The video

Lea Verou gave a very clear talk on regular expressions at the fluent conference in 2012. The talk is at a Javascript conference, but the syntax of the regexes used is just as applicable to Java in most common cases, as explaned above.

There is a quiz in the middle. You may want to pause the video to try your own hand at the problems.

/Reg(exp){2}lained/: Demistify Regular Expressions

2. Exercises Week 10

2.1. Regular Expressions

Task description in task description regex The promised LaTeX file is here

2.2. Templating Engine

Use case: Think serial mail or mail merge or something similar.

The task description Templating engine . The project will be in your repo.

The code is also a kind of template, you need to fill in the empty spots, like in an assessment.

There will be talk about sigil, a magic sign. In the example we use two: '{{' as starter and '}}' as terminator, but the solution is flexible enough to take any other pair you like. Sigil stands for the character or character-sequence given and is there to make parsing of template text easier. By choosing a proper set, they will not handicap what you can write in you template text. The defaults are quite reasonable. And if you do, you can always escape.


sigil symbols