Hello Everyone,
I am running this loop given below to find out any html tags(<>or </>)
from an HTML document but the problem is that it is consuming lot of execution time. Can u plz suggest me any other way or alternative to sort out this problem.
P.S. The target_data is the data I m extracting from a file and it's size can be very large enough.
$pattern='(\<[^\>]{1,300}\>)'; while ($target_data=~m/$pattern/gi) { $m=$1; $space=''; $space=' ' x length($m); $target_data=~s/$pattern/$space/i; print $m."\n"; }
Janitored by davido: Added formatting and code tags to reflect the OP's input layout.
Retitled by davido per consideration.
In reply to Stripping HTML tags efficiently by agynr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |