[Israel.pm] Re: cutting characters from a string

Shlomi Fish shlomif at vipe.stud.technion.ac.il
Fri Jan 9 10:18:01 PST 2004


On Fri, 9 Jan 2004, Lena Farid wrote:

>
> Hi ppl,
>
> I need to cut certain characters from a string .
> +'events/news.htm"><img   this is my string and i want to only have
> events/news.htm without the rest
> i'm using ~ y/[+\"\'<>*]//d to remove the characters specified within
> the [ ] but is there a way to tell perl to cut everything before and
> after events/news.htm? becasue the alphabetical characters after the
> part I need aren't always the same
>
> Any tips?
>

How about:
$mystring =~ /(\w+\/\w+\.htm)/;
my $url = $1;

Regards,

	Shlomi Fish

> thanx in advance,
>
> Lina
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
>
> YAPC::Israel::2004
> http://www.perl.org.il/YAPC/2004/
>



----------------------------------------------------------------------
Shlomi Fish        shlomif at vipe.technion.ac.il
Home Page:         http://t2.technion.ac.il/~shlomif/

You are banished! You are banished! You are banished!

Hey? I'm just kidding!



More information about the Perl mailing list