Exercises, examples and other material relating to training module Q802. This topic is presented on public courses
Regular Expressions,
Intermediate Python
Regular expressions comprise a number of element types such as literals, counts and assertions. In this module, we introduce you to these fundamental elements and show you how to start to build powerful patterns using them.
Related technical and longer articles
Pattern Matching - a primer on regular ExpressionsSolution Centre - all article listingSolution Centre - all article listing
Articles and tips on this subject | updated |
4763 | Regex Reference sheet For PCRE (Perl Compatible Regular Expressions)
Character classes
[abcd]
[^abcd]
[A-J]
[[:word:]] style
alnum letters and digits
alpha letters
ascii character codes 0 - 127
blank space or tab only
cntrl control characters
digit decimal digits (same as \d)
graph printing characters, excluding space
lower lower ... | 2017-10-11 (longer) |
4505 | Regular Expressions for the petrified - in Ruby Regular Expressions ... frighten ... newcomers at their apparent peverseness and complexity. But they need not - regular expressions are made up of just a handful of types of elements and once you realise this, they become easy!
The background is that you want to ask is a string of text looks like ... | 2015-06-03 |
2804 | Regular Expression Myths Does this look good to you?
/.*\S+[@]\S+.*/
It shows some regular expression myths that I would like to explode!
Myth 1. If you want to match a specific character, you must put it in square brackets.
WRONG ... Square Brackets are a grouping - if you're looking to match just a single specific ... | 2010-06-18 |
1849 | String matching in Perl with Regular Expressions Some languages used adaptive or overridden operator to perform a task depending on the operands - for example in Java, the "+" operator adds numbers, but concatenates strings, and in PHP the == operator compares numbers or strings, depending on the operand types. But in Perl 5, it's often up to the ... | 2008-11-02 |
1799 | Regular Expressions in PHP Regular Expressions allow you to check if a string of text matches a particular pattern - for example to see if the data that a user has entered into a form looks like a Postcode / zipcode ... and then to extract the vital parts of the string that you're checking into separate variables.
Down the left ... | 2008-09-16 |
1766 | Diagrams to show you how - Tomcat, Java, PHP I like to work with a flipchart occasionally, and I have been doing so quite a bit this week, which is a week that I'm giving a wide ranging web server deployment course under Linux, covering both LAMP / PHP technologies, and Tomcat / Java too. Why do I like using a flipchart? Because it encourages ... | 2008-08-24 (longest) |
1480 | Next course - 7th January 2008, Regular Expressions Yesterday afternoon ... I finished my training for 2007, and I'm now looking forward to two weeks of days with a different metric. Don't get me wrong - I utterly enjoy the training but all sorts of things have been stacking up to attend to including personal time. So it's not "quiet" but rather "different".
In ... | 2007-12-21 |
453 | Commenting Perl regular expressions Do you sometimes find Perl regular expressions hard to follow? If you do, remember that you can use the "x" modifier which allows you to space them out; with the "x" modifier, white spaces in the regular expression are ignored.
You can go further; once you've specified the "x" modifier, you can ... | 2006-06-05 |
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
[here].
Topics covered in this module
Literals.
Assertions.
Character groups.
Special character groups - Perl.
Special character groups - POSIX.
Special character groups - \p.
Any character.
Counts.
Bracketing.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Ruby,
Lua,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.