mirror of
https://github.com/kennethreitz-archive/parse.git
synced 2026-06-05 15:30:18 +00:00
ReST edits
This commit is contained in:
+3
-5
@@ -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')
|
||||
<Result (42,) {}>
|
||||
|
||||
.. 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(">{}<", "<p>some <b>bold</b> text</p>")
|
||||
|
||||
@@ -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')
|
||||
<Result (42,) {}>
|
||||
|
||||
.. 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(">{}<", "<p>some <b>bold</b> text</p>")
|
||||
|
||||
Reference in New Issue
Block a user