*. zero or more of the preceeding character. a* = blank (empty string), a, aa, aaa,…

48
*

Upload: henry-chambers

Post on 05-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

*

Page 2: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

zero or more of the preceeding character. A* = blank (empty

string), A, AA, AAA,…

Page 3: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

+

Page 4: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

1 or more of the preceeding character. B+ = B, BB, BBB, …

Page 5: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

?

Page 6: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

zero or one of the preceeding char. A? = blank, A

Page 7: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

|

Page 8: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

OR. A|B = A, B alternative = [ ]

Page 9: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

(a+|b+)cc

Page 10: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

acc, bcc, aacc, bbcc, GROUPING: gray | grey = gr(a|e)y; @([_a-zA-Z\d\-]+(\.[_a-zA-

A\d\-]+)+)

Page 11: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

{a, b, c}

Page 12: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

{ } the set of alphabet for a language

Page 13: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

\

Page 14: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

backslash = escape (the orginal meaning of the char follows it). \. = decimal point, . = any char

Page 15: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

[ab]

Page 16: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

a or b. [a-z] = a single char between a-z.

Page 17: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

^ caret

Page 18: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

NOT. ^t = the string cannot contain t

Page 19: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

. Period or dot

Page 20: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

any character (almost)

Page 21: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

- class, inside [ ]

Page 22: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

[a-z] matches all 26 letters. [a-zA-Z] matches all 52 letters.

Hyphen

Page 23: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

$ the dollar sign

Page 24: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…
Page 25: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

\d

Page 26: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

matches a single numeric character, [0-9];

Page 27: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

\w

Page 28: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

matches a single alphanumeric character = [a..z, A..Z, 0..9] [a-

zA-Z0-9]

Page 29: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

\W

Page 30: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

matches a non-alphanumeric character = [^\w]

Page 31: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

\D

Page 32: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

matches a non-numeric character = [^\d]

Page 33: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

\s

Page 34: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

matches a single space character

Page 35: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

\S

Page 36: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

matches a single non-space character

Page 37: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

[\.\d+]

Page 38: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

=.123, or .365, etc

Page 39: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

* and +

Page 40: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

first, then concatenation, then | (or)

Page 41: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

BNF

Page 42: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

::=; <non-terminal symbols>; | ; terminal symbol; alphabet

Page 43: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

Syntax diagram

Page 44: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

non-terminal symbols rect box; terminal symbols oval box.

Page 45: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

RPN

Page 46: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

Reversed Polish Notation, Postfix notation, simpler for

machine to evaluate. No brackets.

Page 47: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

(0|1)*

Page 48: *. zero or more of the preceeding character. A* = blank (empty string), A, AA, AAA,…

any order. * first then the |.