Changes between Initial Version and Version 1 of pyparsing


Ignore:
Timestamp:
05/25/10 17:20:19 (15 years ago)
Author:
Praneeth Bodduluri
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyparsing

    v1 v1  
     1
     2pyparsing can be found in the trunk from revision 684 onwards. 
     3
     4pyparsing providers a simple way of creating parsers for logical text patterns.
     5
     6A simple tutorial for pyparsing could be found at :  http://www.rexx.com/~dkuhlman/python_201/python_201.html#SECTION007600000000000000000
     7
     8Documentation for pyparsing is located at : [http://crpppc19.epfl.ch/doc/python-pyparsing/HowToUsePyparsing.html]
     9
     10
     11Example usage is shown below.
     12
     13{{{
     14from pyparsing import delimitedList,Word,alphanums,ParseException,Group                             
     15from pyparsing import Suppress,nums                                                                 
     16                                                                                                   
     17resource = delimitedList(Word(alphanums+"_"),'/')                                                   
     18                                                                                                   
     19phone = Word(nums) # doesnot accept country code yet                                               
     20                                                                                                   
     21address = (Suppress("eden.")+resource) | phone | Word(alphanums+"_ . + @ ")                         
     22                                                                                                   
     23addresses = delimitedList(Group(address))                                                           
     24                                                                                                   
     25string = "eden.pr_person/1/asd,eden.la/1/1,9935648569"   
     26add = addresses.parseString(string)                               
     27print add
     28                                 
     29------------
     30==> Result
     31
     32[['pr_person', '1', 'asd'], ['la', '1', '1'], ['9935648569']]
     33
     34}}}