diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..493b519
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,8 @@
+[*.php]
+charset = utf-8
+
+indent_style = tab
+indent_size = 4
+
+end_of_line = lf
+insert_final_newline = true
diff --git a/.mddoc.xml.dist b/.mddoc.xml.dist
index 9447d1e..67176d1 100644
--- a/.mddoc.xml.dist
+++ b/.mddoc.xml.dist
@@ -15,6 +15,10 @@ DotNotationParser is a simple parser that will parse `foo.bar.baz` into `[ 'foo'
+
diff --git a/README.md b/README.md
index 589a07e..ecea5bc 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,58 @@ Install the latest version with:
composer require 'quorum/dot-notation'
```
+## Example
+
+```php
+ 'foo bar.baz',
+ 'dots are accepted in quotes' => '"foo.bar".baz',
+ 'quotes are escaped with backslashes' => '"foo\"bar\"".baz',
+];
+
+foreach( $tests as $descr => $test ) {
+ echo sprintf("Parsing '%s'%s\n",
+ $test,
+ is_numeric($descr) ? '' : ' - ' . $descr);
+
+ $parts = $parser->parse($test);
+
+ echo sprintf("[ %s ]\n", implode(", ", array_map(
+ function ( $a ) { return var_export($a, true); },
+ $parts)));
+ echo "\n";
+}
+
+```
+
+```
+Parsing 'foo'
+[ 'foo' ]
+
+Parsing 'foo.bar'
+[ 'foo', 'bar' ]
+
+Parsing 'foo bar.baz' - spaces are allowed
+[ 'foo bar', 'baz' ]
+
+Parsing '"foo.bar".baz' - dots are accepted in quotes
+[ 'foo.bar', 'baz' ]
+
+Parsing '"foo\"bar\"".baz' - quotes are escaped with backslashes
+[ 'foo"bar"', 'baz' ]
+
+```
+
## Documentation
### Class: Quorum\DotNotation\DotNotationParser
@@ -53,4 +105,4 @@ quoted keys.
##### Returns:
-- ***string[]***
+- ***string[]***
\ No newline at end of file
diff --git a/example/example.php b/example/example.php
new file mode 100644
index 0000000..731080d
--- /dev/null
+++ b/example/example.php
@@ -0,0 +1,28 @@
+ 'foo bar.baz',
+ 'dots are accepted in quotes' => '"foo.bar".baz',
+ 'quotes are escaped with backslashes' => '"foo\"bar\"".baz',
+];
+
+foreach( $tests as $descr => $test ) {
+ echo sprintf("Parsing '%s'%s\n",
+ $test,
+ is_numeric($descr) ? '' : ' - ' . $descr);
+
+ $parts = $parser->parse($test);
+
+ echo sprintf("[ %s ]\n", implode(", ", array_map(
+ function ( $a ) { return var_export($a, true); },
+ $parts)));
+ echo "\n";
+}