Skip to content

Commit

Permalink
Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasdiem committed Sep 27, 2014
1 parent 70c6a8b commit 51e1e15
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions ch03/3.3/3.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for each of the following languages:

### 3.3.2

Describe the languages denoted by the following regular ex­ pressions:
Describe the languages denoted by the following regular expressions:

1. a(a|b)\*a
2. ((ε|a)b\*)\*
Expand All @@ -38,7 +38,7 @@ Describe the languages denoted by the following regular ex­ pressions:

### 3.3.3

In a string of length n , how many of the following are there?
In a string of length n, how many of the following are there?

1. Prefixes.
2. Suffixes.
Expand Down Expand Up @@ -198,7 +198,12 @@ Note that these regular expressions give all of the following symbols (operator
\ " . ^ $ [ ] * + ? { } | /
```

Their special meaning must be turned off if they are needed to represent them­ selves in a character string. We can do so by quoting the character within a string of length one or more; e.g., the regular expression "\*\*" matches the string \*\* . We can also get the literal meaning of an operator character by preceding it by a backslash. Thus, the regular expression \\\*\\\* also matches the string \*\*. Write a regular expression that matches the string "\\.
Their special meaning must be turned off if they are needed to represent
themselves in a character string. We can do so by quoting the character within a
string of length one or more; e.g., the regular expression "\*\*" matches the
string \*\* . We can also get the literal meaning of an operator character by
preceding it by a backslash. Thus, the regular expression \\\*\\\* also matches
the string \*\*. Write a regular expression that matches the string "\\.

#### Answer

Expand All @@ -208,15 +213,21 @@ Their special meaning must be turned off if they are needed to represent them­

### 3.3.9 !

The regular expression r{m, n} matches from m to n occur­ rences of the pattern r. For example, a [ 1 , 5] matches a string of one to five a's. Show that for every regular expression containing repetition operators of this form, there is an equivalent regular expression without repetition operators.
The regular expression r{m, n} matches from m to n occurrences of the pattern r.
For example, a [ 1 , 5] matches a string of one to five a's. Show that for every
regular expression containing repetition operators of this form, there is an
equivalent regular expression without repetition operators.

#### Answer

r{m,n} is equals to r.(m).r | r.(m + 1).r | ... | r.(n).r

### 3.3.10 !

The operator ^ matches the left end of a line, and $ matches the right end of a line. The operator ^ is also used to introduce complemented character classes, but the context always makes it clear which meaning is in­ tended. For example, ^[^aeiou]*$ matches any complete line that does not contain a lowercase vowel.
The operator ^ matches the left end of a line, and $ matches the right end of a
line. The operator ^ is also used to introduce complemented character classes,
but the context always makes it clear which meaning is intended. For example,
^[^aeiou]*$ matches any complete line that does not contain a lowercase vowel.

1. How do you tell which meaning of ^ is intended?
2. Can you always replace a regular expression using the ^ and $ operators by an equivalent expression that does not use either of these operators?
Expand Down

0 comments on commit 51e1e15

Please sign in to comment.