in reply to regex help
In your input data, 23456 is in every line. This above will strip tags and then skip lines with 23456 in it. But with the input data you posted, it wont return any data because every line contains 23456.use strict; use warnings; while(my $html = <DATA>){ $html =~ s/<.*?>//g; next if ($html =~ /23456/); print $html; } __DATA__ <p>Find more business news at facebook.com and twitter.com. Text BUSIN +ESS to 23456 for breaking business news text alerts on your mobile ph +one. Text JOBS to 23456 for job alerts.</p> <p>Want your news even faster? Text NEWS to 23456 to sign up for break +ing news text alerts. See for a complete list of alerts.</p> <br>SIGN UP FOR MOBILE NEWS ALERTS! Get your news on the go, text NEWS + to 23456
to the above code and it will search and replace 23456. But i am really unsure why you want to skip all lines containing 23456, because all the lines in your input data contain 23456.$html =~ s/23456/123456789/g;
|
|---|