#!/usr/bin/perl -w use strict; my $line = 'https://domain.com/account/confirm_email/JodiImus40/589HC- +CG26G-133578 Once you confirm, you will have full access and all futu +re n= otifications will be sent to this email address.'; #just print the first URL part my ($url) = $line =~ /^\s*(\S+)/; print "$url\n" if $url; #https://domain.com/account/confirm_email/JodiImus40/589HC-CG26G-13357 +8 #edit $line to remove all but the first URL part $line =~ s/^\s*(\S+).*/$1/; print $line; #https://domain.com/account/confirm_email/JodiImus40/589HC-CG26G-13357 +8
In reply to Re: Perl regular expression
by Marshall
in thread Perl regular expression
by danny0085
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |