diff --git a/README.rst b/README.rst index 37f512d..a3b66ff 100644 --- a/README.rst +++ b/README.rst @@ -14,13 +14,11 @@ From there it's a simple thing to parse a string: Or to search a string for some pattern: ->>> search('Age: {:d} -', 'Name: Rufus -Age: 42 -Color: red -') +>>> search('Age: {:d}\n', 'Name: Rufus\nAge: 42\nColor: red\n') +.. please excuse the double-backslash in that example; it's a ReST work-around + Or find all the occurrances of some pattern in a string: >>> ''.join(r.fixed[0] for r in findall(">{}<", "

some bold text

") diff --git a/parse.py b/parse.py index 3faf77b..98c8415 100644 --- a/parse.py +++ b/parse.py @@ -14,9 +14,11 @@ From there it's a simple thing to parse a string: Or to search a string for some pattern: ->>> search('Age: {:d}\n', 'Name: Rufus\nAge: 42\nColor: red\n') +>>> search('Age: {:d}\\n', 'Name: Rufus\\nAge: 42\\nColor: red\\n') +.. please excuse the double-backslash in that example; it's an ReST work-around + Or find all the occurrances of some pattern in a string: >>> ''.join(r.fixed[0] for r in findall(">{}<", "

some bold text

")