Code Directory
 Visual Basic & VB.NET
New Code
Social Media Script 1.0
ByteScout PDF Renderer SDK
Magento Mobile App Builder 2.0.0
Binary MLM Plan 1.0.2
Review Assistant 4.0
SSIS Data Flow Components 1.8
Maulik Shah 1.0
GetOrgChart 2.4.91
ODBC Driver for SQL Azure 2.4
EntityDAC 2.0
CarMax Clone Script 1.0
Mega Menu Magento 2 2.0
Luxand FaceSDK 6.5.1
Data Puppy Lite (64-bit) 1.0
Bytescout BarCode Reader SDK
Top Code
Bopup IM Client SDK 1.0.0
Library Management System 1.0
Readymade Wedding Directory Script 1.0.2
Open Source Practice Management Project 1.0
Event Ticketing System by PHPJabbers 1.0
Notebook Mini 1.0
FLAM Player for Music and Sound 1.56
Visual Python IDE 1.0
Chess Master 1.0
Calorie Calculator -
Stani's Python Editor 1.0
PHPtravels 1.1
ABPollMaster 1.I
Graphical Sorting Program Script 1.1
HTMLPad 2007 Pro 8.3
Top Rated
Output Messenger 1.8.0
Aliexpress Clone- Ec21 Script 1
Indiegogo Clone 3.0
Online Food Ordeing System 1.0
PHP Image Resize Script 1.0
Best Spotify Clone 1.0
Get Random Record Based on Weight 1.0.0
Travel Portal Script 9.29
Magento Product Designer 1.0
OFOS - Just Eat Clone Script 1.0
PrestaShop Upload Images Module 1.2.1
Trading Software 1.2.4
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Simple regex engine, elementary Python 
File ID: 64721

Simple regex engine, elementary Python 
Download Simple regex engine, elementary Python Error Link
License: Freeware
Downloads: 8
User Rating:3 Stars  (1 rating)
Submit Rating:
Simple regex engine, elementary Python  Description
Description: A short engine for testing against a regex, understanding the 3 common quantifiers
?,+,* (non-greedy) working on characters, ., [...], [^...], s, S, bracketed patterns and group designators N. Accepts unicode objects and fixed-width encoded strings
(but problems with eventual comparisons of trailing bytes in multi-byte utf-letters).
Captures up to 10 groups ( (?:...) implemented), which can be used for back referencing and in xreplace(). Captured groups are accessible after the search in the global list xGroups. | is supported, but only in groups and needing nested=True. nested=False is making '(' and ')' common letters.

This is not about Python or for Python, there it has little use beside re. But regarding that re needs about 6,000 lines you might agree with the author, that these 176 lines are powerful. This was the reason to publish it as a recipe - as a kind of (fairly complete) minimal example of a regex tester and as an example for corresponding recursive structures in data (TokenListCache) and code.

Working on this improved the author's understanding of regular expressions - especially of their eventual "greed". "Greedy" quantifiers are a concept, which has to be explained seperately and is coming unexpected: Whoever is scanning a text for '<.*>', s/he will search SGML tags, not the whole text. Even with the star's "greediness" the code has to take care, that '.*' doesn't eat the whole text finding no match for '<.*>' at all. Thus the standard syntax with greedy quantifiers cannot be simpler to implement than this with its mere 3 lines 101, 111 and 121 preventing any greed. Perhaps it is faster - otherwise it is difficult to understand, why the concept "greed" is existing at all.

This engine might be useful here and then under circumstances with nothing else available. Its brevity eases translation to other languages and it can work with arbitrary characters for STAR or PERHAPS (for example).

License: Freeware

Related: cached, Parse, Parsing, recursion, regular expressions


Downloads: 8

More Similar Code

PSPE (Pascal's Simple PHP Engine), is a web site (building tool) written in PHP, with a little DHTML (and JavaScript) features, the content is in XML format. An easy to install procedures roundsup the feature list.

Soe stands for Simple OpenGL Engine.This projects aims at giving a simple framework when dealing with 3D.

Simple yet powerful templating engine for Python. Emphasis has been placed on ease of use. Simply put this file into your project directory and do "import template".

htmltmpl is a templating engine for Python and PHP.

It is targeted to web application developers, who want to separate program code and design (HTML code) of their projects. Even webdesigners can easily learn its simple but powerful...

htmltmpl is a templating engine for Python and PHP.

It is targeted to web application developers, who want to separate program code and design (HTML code) of their projects. Even webdesigners can easily learn its simple but powerful...

This is a simple template engine which allows you to replace macros within text. This engine allows for attributes and filters. The default implementation provides the entire string module as filters. Trying to use arguments will of course not...

Ikko is a very simple templating engine.

A search engine to Python Library Reference which can be downloaded for off-line use

this is a simple calculator maked whith python and gtk.

RedBLoG is a simple blog engine for who want a personal blog with support for categories, a little image gallery and download management system. RedBLoG is totally written in php and is released under GPL license.

User Review for Simple regex engine, elementary Python
- required fields

Please enter text on the image