Project Advice

Project Advice

3. Regular expressions

3.4 Exercise

Using an editor of your choice, get the following tasks to work using a regular expression

  1. Find all head elements, and their contents.
  2. Find all occurrences of the name Smith, spelled Smith, Smyth, Smithe or Smythe, and put them in a persName tag with a standardised Smith attribute value.
  3. Find a head followed by a line break and replace the head without the line break.