Regular languages Flashcards
Define a finite state machine
An abstract model of computation that is used to model logic
When is a language considered regular?
Only if it can be recognised by a FSM
Define regular languages
A formal language compromised of a set of strings
What’s a state transition diagram?
A model of a finite state machine
What’s an accepting state?
Indicated by a double circle, it’s reached when a valid string is entered
What’s a Mealy machine?
A FSM which produces an output determined by its current state and the input
Define regular expressions
A compact notation to describe a set of strings that make up a regular language
How do regular expressions work?
They work on the principle of providing characters that must be matched
What are regular expressions used for?
Searching strings, Implementing find & replace functions, validating user input
What are metacharacters?
Symbols used to help you interpret regular expressions
+
One or more preceding characters/ group of characters
*
Zero or more of the preceding characters/group of characters
?
Zero or one of the preceding characters/ group of characters
|
Alternation (what is on the left or what is on the right)
()
Defines a group