Update
This commit is contained in:
parent
66fe12a69c
commit
136d0905dd
9 changed files with 1697 additions and 1694 deletions
2
regex.md
2
regex.md
|
@ -201,7 +201,7 @@ int main(void)
|
|||
}
|
||||
```
|
||||
|
||||
Just compile this and pass a string to the standard input (e.g. `echo "<testing> string | ./program"`), it will write out if it matches or not.
|
||||
Just compile this and pass a string to the standard input (e.g. `echo "<testing> string" | ./program`), it will write out if it matches or not.
|
||||
|
||||
Maybe it seems a bit overcomplicated -- you could say you could program the above even without regular expressions and state machines. That's true, however imagine dealing with a more complex regex, one that matches a quite complex real world file format. Consider that in [HTML](html.md) for example there are pair tags, non-pair tags, attributes inside tags, entities, comments and many more things, so here you'd have great difficulties creating such parser intuitively -- the approach we have shown can be completely automatized and will work as long as you can describe the format with regular expression.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue