Regexpr FTP

Discussion in 'Perl' started by MC, Feb 4, 2005.

  1. MC

    MC Guest

    Hi,

    i'm trying to make a regexpr wether an ftp-input is valid or not.
    this is what i have:

    $var = "ftp://user:pass@localhost:21";
    if ( $var =~ /^ftp:\/\/([^:]*):([^@]*)@([^:]*):(.*)$/i ) { print
    "$1:$2@".$3.":$4\n"; }Can anyone tell me if something is wrong with
    this?For some reason it won't accept the "@" in the middle,if i replace it
    with "!" for example the expr works just fine.i've also tried escaping it,
    also no luck.Thanks
    MC, Feb 4, 2005
    #1
    1. Advertising

  2. MC

    Jim Gibson Guest

    In article <420340e0$0$560$>, MC <madcow@false>
    wrote:

    > Hi,
    >
    > i'm trying to make a regexpr wether an ftp-input is valid or not.
    > this is what i have:
    >
    > $var = "ftp://user:pass@localhost:21";
    > if ( $var =~ /^ftp:\/\/([^:]*):([^@]*)@([^:]*):(.*)$/i ) { print
    > "$1:$2@".$3.":$4\n"; }Can anyone tell me if something is wrong with
    > this?For some reason it won't accept the "@" in the middle,if i replace it
    > with "!" for example the expr works just fine.i've also tried escaping it,
    > also no luck.Thanks


    You need to escape the '@' in $var. If I do that, it works fine for me.
    If you had put 'use strict;' and 'use warnings;' at the beginning of
    your program perl would have told you that. Next time, please show a
    complete program that demonstrates your problem, and please post to
    comp.lang.perl.misc instead because this newsgroup is defunct.


    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
    Jim Gibson, Feb 4, 2005
    #2
    1. Advertising

  3. Jim Gibson wrote:
    > Next time, please show a
    > complete program that demonstrates your problem, and please post to
    > comp.lang.perl.misc instead because this newsgroup is defunct.
    >


    Out of interest, what does being "defunct" mean? How does one know that it is the case?

    Obviosuly people are writing to and reading this group... what
    status does 'defunct' confer?

    Ta,
    Martin Gregory, Feb 7, 2005
    #3
  4. MC

    Jim Gibson Guest

    In article <cu8uq7$if9$>, Martin Gregory
    <> wrote:

    > Jim Gibson wrote:
    > > Next time, please show a
    > > complete program that demonstrates your problem, and please post to
    > > comp.lang.perl.misc instead because this newsgroup is defunct.
    > >

    >
    > Out of interest, what does being "defunct" mean? How does one know that it
    > is the case?


    I know it is defunct because people tell me it is defunct. :)

    >
    > Obviosuly people are writing to and reading this group... what
    > status does 'defunct' confer?


    It means the Usenet protocol command 'rmgroup' was issued for this
    newsgroup. This happened many years ago. However, improperly-configured
    newservers (like the ones you and I are accessing) can continue to
    publish and receive articles posted to comp.lang.perl.

    See http://tinyurl.com/4skts for the best description I have seen of
    the status of comp.lang.perl.

    To repeat: comp.lang.perl is defunct!


    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
    Jim Gibson, Feb 8, 2005
    #4
  5. Jim Gibson wrote:

    >
    > To repeat: comp.lang.perl is defunct!


    But we'll read it anyhow :)
    Martin Gregory, Feb 9, 2005
    #5
    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. Jonas
    Replies:
    3
    Views:
    366
    Gunnar Hjalmarsson
    Aug 11, 2004
  2. someone

    FTP over SSL vs FTP over SSH

    someone, Apr 24, 2004, in forum: Java
    Replies:
    1
    Views:
    4,566
    iksrazal
    Apr 25, 2004
  3. Replies:
    1
    Views:
    117
    Austin Ziegler
    Jul 28, 2005
  4. Richard Bell

    regexpr question is w2 taken

    Richard Bell, Apr 15, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    98
    Anno Siegel
    Apr 16, 2004
  5. D. Buck
    Replies:
    2
    Views:
    465
    D. Buck
    Jun 29, 2004
Loading...

Share This Page