|
Online Seminar
Register:
|
$$395
Webinar uses GotoMeeting®; we help with setup
Requires computer speaker or headset
Time: two afternoons, 2pm to 5pm
|
Onsite training available
1-on-1 training available
Call us for details
|
Pattern-matching for Programmers
Patter-matching is an essential skill for any professional programmer, regardless of the language used. In this two-session class, we cover the basics of pattern-matching. We use Perl to demonstrate the examples, but we also demonstrate, and include source code for, the same pattern-matching techniques using other programming languages and even text editors. Initially we invest a half-hour in teaching everyone just enough Perl to start performing pattern matches. After the first example of pattern-matching, we invest another half-hour in demonstrating how you would change the syntax slightly to perform the same pattern match in each other popular programming language: JavaScript, Java, .Net, PHP, and in the popular Eclipse IDE. We show you how to:
- Learn just enough Perl to perform pattern-matching operations (1/2 hour)
- Find whether a pattern exists in some text
- Use special symbols to represent white space, word boundaries, digits, alphanumeric characters, etc.
- Use special symbols to represent arbitrary characters
- Perform the same pattern test in JavaScript, Java, .Net, PHP, and Eclipse
- Search for one or more instances of an arbitrary character
- Search for zero or more instances of an arbitrary character and see why this is important
- Perform "lazy" matches to distinguish the shortest (i.e., first) instance of a pattern found
- Memorize the instance of the pattern found, and store it in a variable
- Capture an array of instances where the pattern was found, and iterate through them afterwards
- Replace pattern instances in phrase with a word, whether one-time-only, or repetitively
- Replace pattern instances with dynamically-built phrases incorporating the pattern instance
- ...and much more!
By the end of this class, you will be able to use pattern-matching to perform operations such as:
- Extract email addresses from text files
- Parse log files into IP addresses, dates, times, etc.
- Replace HTML tags, with or without attributes, with slightly modified versions: for example, replacing <hr class="big"> with <hr id="big"> without changing other tags using the "class" attribute
- Parse emails into username, company, and top-level domain: jsmith@ibm.com can be parsed into user "jsmith" at company "ibm" in the ".com" domain
- Parse tab-delimited output (such as from log files or database exports to text) into arrays of words
Prerequisites:
- Proficiency in at least one programming language: you must understand variables, conditionals, loops, and arrays
|