Perl Topics





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Perl Tutorial
Introduction Introduction
Installing Perl Installing Perl
Basics of Perl Basics of Perl
Scalar Variables Scalar Variables
Operators Operators
Control Structures Control Structures
Lists Lists
Array Array
Arrays Manipulation Arrays Manipulation
Arrays Functons Array Functions
Hash Hash
Hash Functions Hash Functions
String Functions String Functions
Regular Expression Regular Expression
Regular Expression Functions Regular Expression Functions
Numerical Functions Numerical Functions
List Functions List Functions
User Defined Function User Defined Function
File Handling File Handling
Forums Ask Your Doubts
Feedback Feedback
 





Regular Expression in Perl


Tutorials Perl

Topic

What is Regular Expression in Perl?



Explanation

Regular expressions are that makes Perl an ideal language for "Practical extraction and reporting" as the name implies.To construct the regular expression, which is essentially a sequence of characters describing the pattern you would like to match. In MS-DOS we use "*.txt" to get all text files, we say this as a pattern, likewise perl uses a set of regular expressions that can be used to specify the patterns, so you can make your search more specific.

After creating a regular expression perl uses binding operators like (=~ or !~) to bind the data to be searched for. Let us see a example.

Perl is used in number of ways:

  • Search for a string that matches a specified pattern
  • Optionally replacing the pattern found with some other strings
  • Counting the number of occurrences of a pattern in a string
  • Split a formatted string (e.g. a date like 02/06/2001) into day, month and year
  • Validation of fields received from HTML forms by verifying it to a particular format





A Note
Simple introduction, basic CGI perl programming codes with examples. Do send your feedback or suggestions on this tutorial. This is a copyright content.

Other Links

web hosting