mirror of
https://github.com/kennethreitz-archive/parse.git
synced 2026-06-05 23:40:17 +00:00
ReST edits
This commit is contained in:
@@ -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