VOOZH about

URL: https://www.geeksforgeeks.org/perl/perl-quotemeta-function/

⇱ Perl | quotemeta() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Perl | quotemeta() Function

Last Updated : 11 Jul, 2025
quotemeta() function in Perl escapes all meta-characters in the value passed to it as parameter. Example:
Input : "GF*..G" 
Output : "GF\*\.\.G"
Syntax: quotemeta(value) Parameter: value: String containing meta-characters Return: a string with all meta-characters escaped
Example 1: Output:
Original String: 
GF*
[.]*G

String after operation: 
GF\*\
\[\.\]\*G
  Example 2: Output:
Original String: 
GF+n{.}/G

String after operation: 
GF\+n\{\.\}\/G
Comment
Article Tags:

Explore