Regular Expression & Shell Scripting Flashcards

1
Q

Regex:

Indentity (=)

A

Find a word that only matches the word you want to search for.

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

Regex:

Optionallity (?)

A

Zero or one. “This piece is matched if the wrapped atom appears in this position zero or one times”.

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

Regex:

Repetition (+)

A

One or more. “This piece is matched if the wrapped atom appears in this position one or more times”.

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

Regex:

Optional rep. (*)

A

Zero or more. “This piece is matched if the wrapped atom appears in this position zero or more times”.

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

Regex:

Abritrary q. ( {n,m} )

A

N to M times. “This piece is matched if the wrapped atom appears in this position at least n and at most m times”.

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

Wildcard:

.

A

The . metacharacter is an atom that matches any character.

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

Wildcard:

[abc]

A

Any of a, b or c. The bracket expression [abc] is an atom that matches any single character from the list of enclosed characters.

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

Wildcard:

Negated set ([^abc])

A

Anything except a, b or c. The bracket expression [^abc] is an atom that matches any single character from the list of enclosed characters.

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

Wildcard:

Rangers ([a-f])

A

Any between a and f. The bracket expression [a-f] is an atom that matches any single character in the range of characters from a to f.

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

[Gg] ?

A

The letter must start with G or g.

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

((aa | bb | cc)) ?

A

aa, bb or cc. The branch (aa | bb | cc) is treated as a single atom (it is a group) and matches if any of the enclosed subsequences of pieces aa, bb or cc matches.

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

^ in a line/string?

A

Defines the beginning of the string/line.

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

$ in a line/string?

A

Defines the end of a string/line.

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

Rm ?

A

Removes files

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

Ls ?

A

List of content in a driectory

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

Cd ?

A

Change Directory

17
Q

Wc ?

A

Word Count

18
Q

Redirection

A

Hello > file1.txt

19
Q

Sort ?

A

Sort the lines in stdin