Training, Open Source computer languages

PerlPHPPythonMySQLhttpd / TomcatTclRubyJavaC and C++LinuxCSS

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Related technical and longer articles
Analysing incoming data lines
Pattern Matching - a primer on regular Expressions
Tips and short articles on this subject
Handling Binary data (.gif file example) in Perl
Ignore case in Regular Expression
Regular expressions made easy - building from components
Substitute operator / modifiers in Perl
Commenting a Perl Regular Expression
Perl, the substitute operator s
Matching within multiline strings, and ignoring case in regular expressions
C++ and Perl - why did they do it THAT way?
Coloured text in a terminal from Perl
Don't expose your regular expressions
Storing a regular expression in a perl variable
Perl Regular Expressions - finding the position and length of the match
Remember to process blank lines
Commenting Perl regular expressions
Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
More on Character Strings - Perl module P212
a.k.a. "Regular Expressions, part 2". How to match a string to a pattern, how to extract information from a match, how to repeat matches, to substitute one string of text for another, and how to translate on a character by character basis.

This topic is presented on public courses Perl Programming, Perl bootcamp

Examples from our training material
bindemo   Printing out and reading in binary numbers
cats2   Sample answer 2
catshow   Sample answer 1
favex.pl   Postcode, Zipcode, credit card no. etc - regular expression matches
filler   Using Regular Expressions to "mailmerge"
getlinks   Find all href links from a page
greedyvglobal.pl   Greedy matches v Global matches
html1   Matching HTML - a greedy match doesn't work
html2   Sparse matching, looking for an HTML tag
html3   Global matching in a scalar context
html4   Global matching in a list context
letters   Look for word starting and ending with same letter
n2   Capturing groups into $1 and $2
n3   Capturing groups into a list
n4   Special variables $' $& and $`
n5   $PREMATCH, $MATCH and $POSTMATCH
name   Match and substitute (long winded way!)
name2   Match and substitute - (example that fails)
name3   Match and substitute executed block
names   Regular expression match - revision
ogado   Anagrams of First Great Western served stations
pcv1   Postcode extractor - mark 1
pcv2   Postcode extractor Mk2 - save into named variables
pcv3   Postcode, Mk3 - extract multiple postcodes
phone   Substitution using back reference
pwline   Character by character translation with tr
pwline2   using tr to change multiple characters; also c and s switches
regextra   Splitting up a URL via a regex - sample exercise answer
rogues   Using tr to find invalid characters in a string
sedm   Substitue operator
totext   Converting < > and & to web standard sequences
yem   Perl regular expression - information returned
ystwyth.pl   binary data handling - examine a .gif file
More web pages on this subject
Regular Expressions in Perl
Opentalk forum discussions related to this topic
any option other than substr
Replace block of HTML
Importing a regular expression from a file
Help in regular expression
Extract first 20 words
Apostrophes
sequence file into a numeric file
Regular Expression Help
RegEx in scalar
Finding the latest version number
return part of a string that matches a pattern
how to tokenize in perl
Variable formatting beyond printf
Use of qq to prevent Mysql injection
Say what you mean in regular expressions
Sample Regular Expressions
RegEx
Perl Regex One Liner To Substitute Multiline Text
Language parsing
Help please with Perl regular expressions
HTML code in Perl
Greedy v Global on regular expressions
Finding all matches to a Regular Expression
Editing multiple files
Pictures
Yes!
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 http://www.training-notes.co.uk.
Topics covered in this module
Summary to date.
Extracting information from a match.
$1, $2, etc.
Assign to a list.
$`, $& and $Õ.
More about regular expressions.
What else can I put in regular expressions?.
More brackets.
Match modifiers.
Global v Greedy.
Alternative delimiters.
Some favourite regular expressions.
To match an email address.
To match a UK Postcode.
To match an American Zip code.
To match a date (UK Style).
To match a time.
To match a complete URL for a web page.
To match a Visa number.
To match a Mastercard number.
To match a UK Phone number.
To match a UK car registration plate.
To match a UK national insurance number.
To match a book's ISBN number.
Substitutions.
Substitute and execute.
Regular expression efficiency.
tr.
Handling binary text.
Summary.
Course links
The following web pages are used as references / examples in this module

[Link] INACCESSIBLE
(at https://cedar.he.net/internal.html#javabooks)

[Link] Graham Ellis - Home Page
(at http://www.grahamellis.co.uk/index.html)

We check these links from time to time with a spider written in PHP. Latest full check was on Saturday, 12th June 2004. Titles are extracted from the web pages listed.

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 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 600 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho