Practical 4
Regular expressions
Navigate to https://regex101.com.
Copy and paste the text below into the
TEST STRINGpage on regex101.Luke Skywalker C-3PO R2-D2 Darth Vader Leia Organa Owen Lars Beru Whitesun Lars R5-D4 Biggs Darklighter Obi-Wan Kenobi Anakin Skywalker Wilhuff Tarkin Chewbacca Han SoloIdentify regular expressions to match:
- Each character’s first name.
- Each character’s last name.
- All names beginning with
L. - Each character’s first and last name as match groups.
TipTips
Use the following hints to define your expressions:
^= start of line$= end of line\b= word boundary