![]() |
Perl Regular Expression![]() ![]() ![]() ![]() ![]()
In fact, you've already seen a number regular expression without knowing what they were. The split function that has appeared in various programs takes a regular expression as its first argument. Remember that the split function searches through a string for a particular substring and then splits the string into smaller strings at the positions where the substring is found. So far, you've had to go faith that you express these arguments with a slash (/), followed by the exact text followed by another slash. @TheFields = split(^t/, $TheRecord); This code will return a list of strings in $TheRecord, where each string is the text between the tab characters (remember that V indicates a tab character), Thus, if $ TheRecord contains 'Speakers," followed by a tab character, followed by "2", followed by another tab character, followed by "High", the split function above would return ('Speakers,' '2', 'High') Thus, the simplest kind of regular expression is just the exact characters you want to specify, such as a single tab character in the preceding example. You can put more than one character between the slashes. For example, assume that you have a database in a text in which you use three hash characters (###) between fields instead of the tab character. Thus, if $TheRecord contains 'Speakers###2###High", you would use @TheFields = split (/###/, $TheRecord);
|
|
PERL Perl Program Data Types Types of Variables Operator Types Functions String Functions Array Functions Expressions Statement Blocks The if Statement Unless Statement While Loops Until Loop For Loop Foreach Loop Jump Keywords Subroutines Perl References Die Function Exit Function Localtime Function Standard Files File Test Operators File Functions Opening Files Reading into Hash Printing Revisited Globbing Splitting a Record into Fields Perl's Special Variables Regular Expression Simple True-False Searches Inexact Matches in Regular Expressions Matching Any Character Characters with Class Special Locations Quantifiers Greedy Matching Modifiers Localtime Function Subsituations Letter for Letter Translations Generating A Simple Report Defining a Report Template Specifying the Picture Line Specifying the Argument Line Adding a Header Writing the ReportDomain Names Home Importance of a domain name How does a web domain name work? Domain name syntax Choosing a domain name Domain Transfer Domain Parking IP AddressWeb Design HTML DHTML XML JAVASCRIPT VBSCRIPT PHOTOSHOPWeb Hosting Web Server Web Server Software Microsoft Internet Information Server Web hosting ISP Shared web hosting Virtual web hosting Dedicated web hosting Web hosting colocation Managed web hostingE Commerce Principles of E-Commerce E-Banking Electronic Payment System E-Security Credit Cards Smart Cards
The Mailbox POP Server SMTP Server IMAP Protocol |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |