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

Lena Farid lina at xtradyne.de
Mon Jan 12 09:15:59 PST 2004


thanx it works perfectly

Shlomi Fish wrote:

>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!
>_______________________________________________
>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/
>





More information about the Perl mailing list