Name

extract_tagged

Synopsis

extract_tagged(text, "
                     TAG1
                     ", "
                     TAG2
                     ", undef, nesting_allowed)

Extracts the initial substring of textthat is bounded by an HTML or XML tag:

# Extract HTML tags but don't allow <HTML> to be embedded
($extracted, $left) =
    extract_tagged($text,"<HTML>","</HTML>",
                    undef,{bad=>["<HTML>"]});
extract_multiple($text, ...)

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.