summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-10-06 06:45:03 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-10-06 06:45:03 +0000
commitcb19493f8d747d4546f3adb92f78effc993428f9 (patch)
tree4bcb6f3d6a9115d7dcc54c0ad0eab64443ada9f2
parent53d55c3ed2cfe70bf844a4604698b3cb9808b03c (diff)
downloadpyparsing-cb19493f8d747d4546f3adb92f78effc993428f9.tar.gz
Add example to LineStart docstring
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@448 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r--src/pyparsing.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py
index c809956..e9842ab 100644
--- a/src/pyparsing.py
+++ b/src/pyparsing.py
@@ -3089,6 +3089,25 @@ class GoToColumn(_PositionToken):
class LineStart(_PositionToken):
"""
Matches if current position is at the beginning of a line within the parse string
+
+ Example::
+
+ test = """\
+ AAA this line
+ AAA and this line
+
+ AAA but not this one
+
+ B AAA and definitely not this one
+ """
+
+ for t in (LineStart() + 'AAA' + restOfLine).searchString(test):
+ print(t)
+
+ Prints::
+ ['AAA', ' this line']
+ ['AAA', ' and this line']
+
"""
def __init__( self ):
super(LineStart,self).__init__()