Language & Regular Expressions Flashcards

1
Q

What is a basic Regex scenario?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the different applications of language and regular expression?

A
  • Processing data - sequences or strings
  • Pattern matching in databases
  • Text searching
  • Checking inputs for conformity for compilers and grammar parsing

Example Applications

  • Search and replace in text including programs
  • Searching in gene/protein sequence databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the basic set notation - Element of…

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the basic set notation - Not an element of….

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the basic set notation - (proper) subset of…

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the basic set notation - Not a (proper) subset of…

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the basic set notation - Subset and equal to

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the basic set notation - Proper subset of

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the basic set notation - Union / ‘OR’

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the basic set notation - Intersection / ‘AND’

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the basic set notation - Not A

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the basic set notation - Empty Set {}

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the basic set notation - Cardinality (Size) of set A

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the basic set rules?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the theory of formal languages?

A
  • Certain letters form certain sentences which form certain paragraphs which form coherent stories
  • Spoken languages are difficult to analyse
  • Most universal language structure
    • Rules for the lang are explicitly stated
    • In terms of what strings of symbols can occur
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are formal languages?

A
  • Alphabet - finite set of fundamental units (symbols, letters and tokens)
    • Uses ∑ as the name of alphabet ∑= {a,q,r}
  • Language - set of strings of symbols from the alphabet
    • As well as specific to the language
  • Words - finite strings that are permissible
    • In the language which can be generated from the alphabet + rules of lang
  • Empty, null string - Epsilon ε or Lambda
17
Q

How do you descibe abstract languages?

A
18
Q

How does concatenation work

A
19
Q

How does the length of strings work?

A
  • Length of a string is the number of characters in the string
  • length(ε) = 0 in any language that includes ε
20
Q

How does reversing strings work?

A
  • Function which reverses strings
  • Reverse(a) = the same strings and letters in backwards order
    • Reverse of a
    • Which is valid even if reverse(a) is not a word in the langague
21
Q

How does generalising the * operator to a set of words work?

A
  • If S = set of words
  • S* = the set of finite strings formed by concatenating words
  • From S including ε where repetition is allowed
22
Q

What are regular expressions?

A
23
Q

What are the basic regex concepts?

A
24
Q

What is regex quantification?

A
25
Q

What are some pattern matching applications?

A

Test if a string matches some pattern

  • Process natural language
  • Scan for virus signatures
  • Search for information on google

Parse Text Files

  • Compile a java program
  • Crawl + index the web
26
Q

WHat are the basic regex operations?

A
27
Q

What are some generalised regex?

A