A regular expression is a shorthand way of representing a set of strings which fit within a certain language. We are learning ...- How to use regular expressions
So that we can ...- State that a language is regular if it can be described using a regular expression
- State that regular expressions are a simple way to represent a set
- Describe simple languages using regular expressions
- Use regular expressions for string matching
- Describe the relationship between a regular expression and a finite state automata
- accepted by a
*deterministic*finite state automaton - accepted by a
*non-deterministic*finite state automaton - represented by a
*regular expression*
- words in documents
- files in folders
- spelling checkers
- commands in a programming language
- validating email addresses
- validating postcodes
- syntax highlighting
- virus signatures
RegEx or RE.
flavours of regular expressions depending on the implementation, so be careful.There are also lots of different pieces of software and platform implementations of regex that you can use. A nice free one is The Regex Coach available as an installer from http://www.weitz.de/regex-coach/. However, since you have to install it, we will be using an online regular expression engine called Regexr.com ...
Click image to visit website
Regular Expression to FSASince a regular language can be described by either a finite state machine or a regular expression, this means that the two are equivalent.
You may wish to revise your work on Finite State Machines before you attempt this!First, watch Barry Browns videos in which he shows you how to convert a regular expression into a Finite State Automata. There are some examples for you to try in the Task which follows. More advanced regular expression to finite state automata examples For instance, consider the following regular expression ...
This is equivalent to the following finite state automata. Notice that this representation has a 'dead state', s3, into which the machine falls if there are any unmatched characters in the input string.
FSA to Regular ExpressionConversion of a given FSA to a Regular Expression by formal mathematical means is rock hard. Instead, we will learn to approximate the corresponding RE from the given FSM which should give you enough ammo to get a reasonable mark in an examination. Strategy : Look for as many unique patterns in the input strings as you can find which will lead to the goal state and write them down. If you can, simplify this collection of expressions by looking for common starting and ending strings and then alternate the bits in between. Simples!See how far you get with these. I'm imagining that ...
Isn't it difficult enough?
END OF TOPIC ASSESSMENT |