473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Regexpr FTP

MC
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
Jul 19 '05 #1
4 2804
In article <42*********************@news.skynet.be>, 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 =---
Jul 19 '05 #2
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,
Jul 19 '05 #3
In article <cu**********@az33news01.freescale.net>, Martin Gregory
<ma************@freescale.com> 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 =---
Jul 19 '05 #4
Jim Gibson wrote:

To repeat: comp.lang.perl is defunct!


But we'll read it anyhow :-)
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Roger Erens | last post by:
Dear list, I'm trying to install python2.3.1 on an SCO-box. After running ./configure --prefix=/usrdir/rogere the output of make shows (among others:) running build running build_ext...
4
by: Tore Ferner | last post by:
Hi, On linux: I'm a newbie and want to make build-versions of python 2.1.3 and it's modules which link against different versions of a library located in directories not mentioned in...
3
by: Jonas | last post by:
Dear members, How can I use a function return value in a regexpr? $tmp=~s/mysearch/myfunction($1)/; sub myfunction { return $v; }
4
by: Friday | last post by:
Being an Old L.A.M.P guy, I beg you to please excuse my ignorance of dot.net (and all things Windows, for that matter). As part of an experiment (to learn enough ASP/VB.net to port a series of ...
5
by: Paul Morrison | last post by:
Hi I have looked at the PHP string functions and I cant see any function to check to see whether a string starts with a certain letter or letters. Is there any way of doing this with the built...
12
by: Limeburner72 | last post by:
Hi, how can I count the number of punctuation characters within a text file prompted from the keyboard?
11
by: ZMY | last post by:
Dear all, I am a real newbie for both python and QNX, but I am still trying to compile Numeric-24.2 under QNX4.25 with python 2.2. I got following error message: $ sudo python setup.py...
1
by: CreativeMind | last post by:
hi all, i m using this function in javascript but there is problem. function thousandseparator(val) { var regexpr=new RegExp('(-?+)({3})'); while(regexpr.test(val)) {...
1
by: =?Utf-8?B?QmlsbCBIZXJ0emluZw==?= | last post by:
I have a regexpr that consist of a set of alternates, e.g: (ABC|DEF|XYZ) I need to know the index (0,1,2) of the alternate that matched. I can't find anything about this (and I've googled it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.