Dear Monks,
I have a situation where I have a string of data which contains essentially encoded html text, and could really be any size. I then take that string and substring it. Once that is done I use a regular expression to search and replace the html encoded tags. I then use another regular expression to attempt to chop off any unclosed html encoding that might be left at the end of the string. To make a long story short my code appears to be working, however I'm sure there is a way to refactor my regular expressions perhaps into a single statement. Any help would be highly appreciated.
Example Code
$string = substr($incoming, 0, 177);
$string =~ s/\<\;?[-.a-zA-Z0-9]*.*?\>\;//gs; #This does a great j
+ob axing anything basically that starts with a < and ends with a >
$string =~ s/\<\;?[-.a-zA-Z0-9]*.*$//gs; #Due to my substring there
+ is sometimes an open bracket such as <img src...chomp
Is there any way to combine the two regex examples? Thanks again.
s;;5776?12321=10609$d=9409:12100$xx;;s;(\d*);push @_,$1;eg;map{print chr(sqrt($_))."\n"} @_;