Skip to content

Commit 4388c88

Browse files
authored
Create README.md
1 parent 36ac6f5 commit 4388c88

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

regex/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#Question: Basic Regex Matcher
2+
3+
Create a basic regex function that returns true if a `string` matches a `pattern`. This particular
4+
regex language only has 2 special characters, `.` and `*`.
5+
6+
* `.` Matches any individual character, one time. The empty string *does not* match `.`
7+
* `*` Matches any number of characters, *including* the empty string.
8+
9+
Examples:
10+
11+
```
12+
string: 'foobar'
13+
pattern: '*'
14+
output: True, since * matches everything
15+
```
16+
17+
```
18+
string: 'foobar'
19+
pattern: 'fo.bar'
20+
output: True, since . matches the second o and everything else matches.
21+
```
22+
23+
```
24+
string: 'foobar'
25+
pattern: '*ob.z'
26+
output: False
27+
```

0 commit comments

Comments
 (0)