Lines Matching refs:text

278 sub extract_tagged (;$$$$$) # ($text, $opentag, $closetag, $pre, \%options)
870 sub extract_multiple (;$$$$) # ($text, $functions_ref, $max_fields, $ignoreunknown)
1016 sub extract($$) # ($self, $text)
1031 Text::Balanced - Extract delimited text sequences from strings.
1049 # Extract the initial substring of $text that is delimited by
1052 ($extracted, $remainder) = extract_delimited($text,$delim);
1055 # Extract the initial substring of $text that is bracketed
1059 ($extracted, $remainder) = extract_bracketed($text,$delim);
1062 # Extract the initial substring of $text that is bounded by
1065 ($extracted, $remainder) = extract_tagged($text);
1068 # Extract the initial substring of $text that is bounded by
1072 extract_tagged($text,"BEGIN","END",undef,{bad=>["BEGIN"]});
1075 # Extract the initial substring of $text that represents a
1078 ($extracted, $remainder) = extract_quotelike($text);
1081 # Extract the initial substring of $text that represents a block
1085 ($extracted, $remainder) = extract_codeblock($text,$delim);
1088 # Extract the initial substrings of $text that would be extracted by
1092 @extracted = extract_multiple($text,
1114 ($extracted, $remainder) = $extract_head->($text);
1161 Note that in a list context, the contents of the original input text (the first
1164 However, if the input text was passed in a variable, that variable's
1166 extracted text. That means that in a list context the various
1169 while ( $next = (extract_quotelike($text))[0] )
1178 removed from the input text. Thus, the following code also processes
1179 each quote-like operation, but actually removes them from $text:
1181 while ( $next = extract_quotelike($text) )
1186 Note that if the input text is a read-only string (i.e. a literal),
1187 no attempt is made to remove the extracted text.
1212 ($remainder = $text) =~ s/\A('(\\.|[^'])*')//s;
1217 ($extracted,$remainder) = extract_delimited($text, "'");
1219 C<extract_delimited> takes up to four scalars (the input text, the
1221 and extracts the initial substring of the text that
1223 characters, the first one encountered in the text is taken to delimit
1234 is also not specified, the set C</["'`]/> is used. If the text to be processed
1239 delimiters>), the remainder of the text, and the skipped prefix (if
1242 original text, and the prefix returned in the third element is an
1251 # Remove a single-quoted substring from the very beginning of $text:
1253 $substring = extract_delimited($text, "'", '');
1257 # beginning of $text:
1259 $substring = extract_delimited($text, "'", '', "'");
1262 # beginning of $text, optionally after some whitespace
1263 # (note the list context to protect $text from modification):
1265 ($substring) = extract_delimited $text, q{"'};
1268 # Delete the substring delimited by the first '/' in $text:
1270 $text = join '', (extract_delimited($text,'/','[^/]*')[2,1];
1273 quote-like pattern. For instance, if C<$text> contained the string:
1294 optional whitespace and a missing text defaults to C<$_>. However, a missing
1321 $text = "{ an '[irregularly :-(] {} parenthesized >:-)' string }";
1325 @result = extract_bracketed( $text, '{}' );
1333 a void context, C<$text> would be replaced by an empty string.)
1337 @result = extract_bracketed( $text, '{[' );
1344 @result = extract_bracketed( $text, '{([<' );
1352 return an empty string. In a void context, C<$text> would be unchanged.)
1360 for example, if C<$text> is:
1362 $text = '<A HREF=">>>>">link</A>';
1366 @result = extract_bracketed( $text, '<">' );
1374 @result = extract_bracketed( $text, '<>' );
1384 @result = extract_bracketed( $text, '<q>' );
1388 $text = '<leftop: conj /and/ conj>';
1426 the remainder of the input text,
1434 On failure, all of these values (except the remaining text) are C<undef>.
1438 failure. In addition, the original input text has the returned substring
1441 In a void context, the input text just has the matched substring (and
1447 C<extract_tagged> extracts and segments text between (balanced)
1492 that must I<not> appear within the tagged text.
1497 extract_tagged($text, '<A>', '</A>', undef, {reject => ['<A>']} );
1502 that are I<not> be be treated as nested tags within the tagged text
1507 extract_tagged($text, undef, undef, undef, {ignore => ['<[^>]*/>']} );
1520 C<extract_tagged> returns the complete text up to the point of failure.
1530 $text = "/para line 1\n\nline 3\n/para line 4";
1532 extract_tagged($text, '/para', '/endpara', undef,
1540 $text = "/para line 1\n\nline 3\n/para line 4";
1542 extract_tagged($text, '/para', '/endpara', undef,
1561 the remainder of the input text,
1573 the text between the opening and closing tags
1581 On failure, all of these values (except the remaining text) are C<undef>.
1584 substring that matched a tagged text (including the start and end
1586 text has the returned substring (and any prefix) removed from it.
1588 In a void context, the input text just has the matched substring (and
1597 extracts text between (balanced) specified tags. In other words,
1622 a reference to a subroutine which in turn takes a single argument (the text to
1630 my $text = shift;
1632 return $extractor->($text);
1680 C<extract_quotelike> takes two arguments: the text to be processed and
1681 a prefix to be matched at the very beginning of the text. If no prefix
1682 is specified, optional whitespace is the default. If no text is given,
1695 the remainder of the input text,
1711 the text of the first block of the operation
1727 the text of the second block of the operation
1743 On failure, all of these values (except the remaining text) are C<undef>.
1748 void context, the input text has the same substring (and any specified
1753 # Remove the first quotelike literal that appears in text
1755 $quotelike = extract_quotelike($text,'.*?');
1763 # Isolate the search pattern in a quotelike operation from $text
1765 ($op,$pat) = (extract_quotelike $text)[3,5];
1807 " || die;\nexit;" (i.e. the remainder of the input text, concatenated),
1823 "This is the message.\n" (i.e. the text of the here document),
1831 "" (a here document has no second left delimiter, second text, second right
1871 a text to process, a set of delimiter brackets to look for, and a prefix to
1875 Omitting the first argument (input text) means process C<$_> instead.
1882 recognized, code blocks are extracted by stepping through the input text and
1915 # Find a while loop in the text
1917 if ($text =~ s/.*?while\s*\{/{/)
1919 $loop = "while " . extract_codeblock($text);
1925 extract_codeblock $text, "(){}", '[^(]*';
1936 Parse::RecDescent uses C<extract_codeblock($text, '{}E<lt>E<gt>')> to extract the code
1950 S<C<extract_codeblock($text, '{}', undef, 'E<lt>E<gt>')>>
2014 text should be skipped or returned as fields. If the value is true,
2020 sequence to the text string.
2024 text. It may optionally also return two further arguments: a string
2025 representing the text left after extraction (like $' for a pattern
2031 of the original text (see examples below).
2034 it is matched against the text in a scalar context with a leading
2053 character is extracted from the start of the text and the extraction
2060 @fields = extract_multiple($text,
2064 This example separates a text into fields which are quote delimited,
2068 @fields = extract_multiple($text,
2075 operator (and removes it from $text):
2077 $quotelike = extract_multiple($text,
2123 extract_tagged($text, undef, undef, undef, {ignore => [$empty_tag]} );
2152 (in this case the input text is not modified in any way).
2173 A non-optional prefix was specified but wasn't found at the start of the text.
2178 particular kind of bracket at the start of the text, and didn't find it.
2194 out of characters in the text before closing one or more levels of nested
2257 modify the matched text to produce a matching closing tag (because
2274 C<extract_tagged> reached the end of the text without finding a closing tag