|
|
quotemeta() Function of Regular Expression in Perl
|
Tutorials

Perl

|
Topic |
What is quotemeta() Function of regular expression in Perl?
How to escape the metacharacters in string?
|
|
Explanation |
|
The quotemeta() function is used to escape all the meta characters in a string.
Syntax:
quotemeta(string);
In the above syntax, quotemeta() function takes a "string" as an argument.
Example to escape metacharacters in string:
#! C:\programfiles\perl\bin\perl
print "content-type: text/html\n\n";
print quotemeta("BC*[.]*");
Result:
BC\*\[\.\]\*
In the above example the metacharacters in the string "*, \, [ , .,]" are escaped using the
quotemeta() function.
|
|
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.
|
|
|
|