How to escape mataCharacters without Backslash it using REGEX?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aurekha
    New Member
    • Sep 2007
    • 34

    How to escape mataCharacters without Backslash it using REGEX?

    Thanks in advance for reply.
    My question is to escape meta characters without backslash it?
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    There is a Tutorial on the Howtos that will explain it better than I can.

    --Kevin

    Comment

    • aurekha
      New Member
      • Sep 2007
      • 34

      #3
      I am thankful for ur reply. But i mean to use METAQUOTE (perlfunc) in regex inorder to escape metacharacters without backslash it.

      Please Help me out.

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        quoted from perldoc: regexp tutorial

        The escape sequence \Q ...\E quotes, or protects most non-alphabetic characters. For instance,

        Code:
            $x = "\QThat !^*&%~& cat!";
            $x =~ /\Q!^*&%~&\E/;  # check for rough language
        It does not protect $ or @ , so that variables can still be substituted.

        Comment

        Working...