[BEGINNER] Regex with ~

Discussion in 'Perl Misc' started by soup_or_power@yahoo.com, Apr 1, 2005.

  1. Guest

    Can someone please explain the regular expression with the tilda?
    What is being matched there?
    Thanks for your help.

    $trap++ if($st_domains =~ /~$user~/i);
    $trap++ if($st_domains =~ /~$tld~/i);
    $trap++ if($st_users =~ /~$user~/i);
     
    , Apr 1, 2005
    #1
    1. Advertising

  2. wrote:
    > Can someone please explain the regular expression with the tilda?
    > What is being matched there?
    > Thanks for your help.
    >
    > $trap++ if($st_domains =~ /~$user~/i);
    > $trap++ if($st_domains =~ /~$tld~/i);
    > $trap++ if($st_users =~ /~$user~/i);


    Why do you ask? Is there any reason to believe that a '~' would match
    anything but a '~'?

    To find out which characters are special in Perl regular expressions:

    perldoc perlre

    (Another thing is that a tilde both before and after e.g. a username
    appears odd to me.)

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Apr 1, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    No Class at ALL!!! beginner/beginner question

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    603
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Feb 3, 2005
  2. Rensjuh
    Replies:
    7
    Views:
    996
    Mabden
    Sep 2, 2004
  3. Replies:
    3
    Views:
    780
    Reedick, Andrew
    Jul 1, 2008
  4. william nelson

    Beginner's Beginner

    william nelson, Apr 11, 2011, in forum: Ruby
    Replies:
    7
    Views:
    229
    7stud --
    Apr 12, 2011
  5. Tobias Weihmann
    Replies:
    2
    Views:
    110
    Malcolm Dew-Jones
    Apr 23, 2004
Loading...

Share This Page