inrexRegular expressions as infix operations | |
Download |
inrex Ranking & Summary
Advertisement
- License:
- Freeware
- Price:
- FREE
- Publisher Name:
- Krister Hedfors
- Publisher web site:
- http://hedfors.se
inrex Tags
inrex Description
Regular expressions as infix operations The inrex package provides regular expressions as infix operations.from inrex import match, search, split, findall, finditerif 'asd 123' |match| r'(\w+) (\d+)': print 'word is', match print 'digit is', matchif 'asd 123' |match| r'(?P< word >\w+) (?P< digit >\d+)': print 'word is', match print 'digit is', matchprint 'asd 123 qwe 456' |findall| r'\d+'print 'asd 123 qwe 456' |split| r'\d+'print 'asd 123 qwe 456' |split(maxsplit=1)| r'\d+' Requirements: · Python
inrex Related Software