Code Directory
 Visual Basic & VB.NET
New Code
Database Workbench Pro 5.4.6
Extensibility Studio 3.0
Bytescout Spreadsheet SDK
Magento 2 Admin Mobile App 1.0
Data Compare for MySQL 5.3
ODBC Driver for Zoho CRM 1.3
ODBC Driver for SugarCRM 1.3
Bytescout PDF To HTML SDK
Azizi search engine script PHP 4.1.10
TaxiSoftr - Taxi Booking & Dispatch Software 1.0
VisualNEO for Windows 18.08.31
AnyMap JS Maps 8.4.0
ODBC Driver for MailChimp 1.3
OrgChart JS 3.0.7
AnyStock Stock and Financial JS Charts 8.4.0
Top Code
Stepping stone algorithum for solving the transhipment problem
Scholarship Award System 1.2.71b
Network Traffic Monitor 0.7
Real Time Battle 1.1
Genetic Algorithm for n-queen problem 1.0
A Shooting Game 1.1
Simplified Gradient Descent Optimization 1.0
SudokuUI 1.0
dbForge SQL Complete 4.8
RealThinClient WebServer 1.8p
Logic Game 1.0
Naive Bayes Classifier 1.0
K-medoids 1.0
Database Workbench Pro 5.4.6
MyDAC 8.6
Top Rated
Output Messenger 1.8.0
Aliexpress Clone- Ec21 Script 1
Indiegogo Clone 3.0
Advanced MLM Software 1.2
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
PHP Point of sale 10.0
Travel Portal Script 9.29
Excel Add-in for Bigcommerce 1.6
Magento Product Designer 1.0
OFOS - Just Eat Clone Script 1.0
PrestaShop Upload Images Module 1.2.1
Trading Software 1.2.4
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