Python pyparsing.stringStart() Examples
The following are 4
code examples of pyparsing.stringStart().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
pyparsing
, or try the search function
.
Example #1
Source File: console.py From medicare-demo with Apache License 2.0 | 5 votes |
def __hasDeclBegin(self, line): if not self.declBegin: import pyparsing as p self.declBegin = p.stringStart+p.Literal("`") self.declBegin.ignore(p.pythonStyleComment) self.declBegin.ignore(p.quotedString) if self.declBegin.searchString(line.strip()): return True return False
Example #2
Source File: pyconsole.py From medicare-demo with Apache License 2.0 | 5 votes |
def __hasDeclBegin(self, line): if not self.declBegin: import pyparsing as p self.declBegin = p.stringStart+p.Literal("`") self.declBegin.ignore(p.pythonStyleComment) self.declBegin.ignore(p.quotedString) if self.declBegin.searchString(line.strip()): return True return False
Example #3
Source File: console.py From medicare-demo with Apache License 2.0 | 5 votes |
def __hasDeclBegin(self, line): if not self.declBegin: import pyparsing as p self.declBegin = p.stringStart+p.Literal("`") self.declBegin.ignore(p.pythonStyleComment) self.declBegin.ignore(p.quotedString) if self.declBegin.searchString(line.strip()): return True return False
Example #4
Source File: strutils.py From oslo.utils with Apache License 2.0 | 5 votes |
def split_by_commas(value): """Split values by commas and quotes according to api-wg :param value: value to be split .. versionadded:: 3.17 """ word = (pp.QuotedString(quoteChar='"', escChar='\\') | pp.Word(pp.printables, excludeChars='",')) grammar = pp.stringStart + pp.delimitedList(word) + pp.stringEnd try: return list(grammar.parseString(value)) except pp.ParseException: raise ValueError("Invalid value: %s" % value)