Extracts delimited text sequences from strings. It implements various extract_-named subroutines to capture the delimited string.
In a list context, all Text::Balanced methods return a list that contains the extracted string with delimiters, the remainder of the string, and the parts of the string that were skipped. Text::Balanced is shipped with the Perl source kit as of 5.8.
Text::Balanced implements the following methods.
extract_bracketed |
Extracts the initial substring of textthat is bracketed with delimiters specified by delimiter. Note that delimiter should contain one of (), {}, [], or <>.
extract_codeblock |
Extracts the initial substring of textthat represents a block of Perl code. This code is specified by delimiter, which contains one of (), {}, [], or <>.
extract_delimited |
Extracts the initial substring of textthat is delimited by two instances of delimiter.
extract_multiple |
Extracts the initial substrings of textthat would be extracted by one or more sequential applications of the specified functions.
extract_quotelike |
Extracts the quoted portion of text.
extract_tagged |
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, ...)
gen_delimited_pat |
Creates a string that represents the optimized pattern that matches a substring delimited by q{ pattern}.
8.204. Text::Abbrev | 8.206. Text::ParseWords |
Copyright © 2002 O'Reilly & Associates. All rights reserved.