Code Directory
 Visual Basic & VB.NET
New Code
Rentonn - Airbnb clone 1.0
VisualNEO for Windows
SentiVeillance SDK Trial 7.0.191272
dbForge SQL Complete 6.1
Uber for E-Scooters 1.0
ODBC Driver for MySQL 2.4
dbForge Schema Compare for MySQL 4.4
dbForge Studio for MySQL 8.1
dbForge Query Builder for MySQL 4.4
dbForge Data Compare for MySQL 5.5
Aqua Data Studio 19.5
ConyEdit for Windows 1.1.1
Database Workbench Pro 5.6.0
.Net VCL for Delphi
Top Code
Panel Method Based 2-D Potential Flow Simulator 1.0
MCU 8051 IDE 1.4.7
Bessel Derivative Zeros 1.0
Hotel Management - Full Board Version 6.55
JLog/JScriptLog - Prolog in Java* rc
Chess Game 3D 1.1
Open Tournament System 1.16.2
Ping Pong Game Code Script 1.1
Pong Solo 1.0
123 Live Help Chat Server Software 2.1
Issue Manager App 1.0
Long-time simulation for a rigid body 1.0
Code39 Decoder SDK/Android 2.5
Bot Actions 6.x-1.x-dev
AJ Matrix Pro - Multi Level Marketing Software 1
Top Rated
Paste phpSoftPro 1.4.1
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
ATN Jobs Software 4.0
ATN Mall 2.0
WeBuilder 2015 13.3
Simple regex engine, elementary Python 
File ID: 64721

Simple regex engine, elementary Python 
Download Simple regex engine, elementary Python Error Link
License: Freeware
Downloads: 9
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: 9

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