PDA

View Full Version : Splitting Variables


crca
10-27-2002, 07:25 AM
I need help.

What i have, is a problem!

I want to check in a veriable ($URLI) to see if there is http:// or http:\\ found and if it is - that it would be removed. Can anyone help me?

Thanks in advance

chrisvmarle
10-27-2002, 12:27 PM
Not sure, not tested, but this should work:

$URLI =~ s/(http:\/\/|http:\\\\)//isg;

Beter one: $URLI =~ s/http:(\/\/|\\\\)//isg;

Mzzl, Chris

And for those how want http, https and ftp filterd (with :// or :\\):
$URLI =~ s/(ftp|https?):(\/\/|\\\\)//isg;

crca
10-28-2002, 07:31 AM
Thanx! It works a treat!