Commits

Jonathan Eunice  committed 7a7a322

fixed docs

  • Participants
  • Parent commits e763852

Comments (0)

Files changed (2)

     from simplere import Re
 
     if some_string in Re(pattern):
-        print _[1]
+        print Re._[1]
         
 There are two things to note here: First,
 this turns the sense of the matching around, asking "is the given string *in*
 Second, the ``in`` test had the side effect of setting the underscore
 name ``_`` to the result. Python doesn't support *en passant* assignment, so
 you can't both test and collect results in the same motion, even though that's
-sometimes exactly appropriate. ``simplere`` uses introspection to get around this
-difficulty and provide neater code.
+sometimes exactly appropriate. 
 
 If you prefer the more traditional ``re`` calls, you can still use them with the
 convenient *en passant* style.::
 
     if Re(pattern).search(some_string):
-        print _[1]
+        print Re._[1]
 
 ``Re`` works even better with named pattern components, such as::
 
     person = 'John Smith 48'
     if person in Re(r'(?P<name>[\w\s]*)\s+(?P<age>\d+)'):
-        print _.name, "is", _.age, "years old"
+        print Re._.name, "is", Re._.age, "years old"
     else:
         print "don't understand '{}'".format(person)
         
 It's possible also to loop over the results::
 
     for found in Re('pattern (\w+)').finditer('pattern is as pattern does'):
-        print found
+        print found[1]
         
 Or collect them all in one fell swoop::
 
 
 ::
 
-    pip install simplere
+    pip install -U simplere
     
 (You may need to prefix this with "sudo " to authorize installation.)
 
 setup(
     name='simplere',
-    version='0.2',
+    version='0.201',
     author='Jonathan Eunice',
     author_email='jonathan.eunice@gmail.com',
     description='Simpler, cleaner access to regular expressions. Globs too.',