NAME
File::CodeSearch::RegexBuilder - Takes in various options and builds a regular expression to check lines of a file
VERSION
This documentation refers to File::CodeSearch::RegexBuilder version 0.7.6.
SYNOPSIS
use File::CodeSearch::RegexBuilder;
# Brief but working code example(s) here showing the most common usage(s)
# This section will be as far as many users bother reading, so make it as
# educational and exemplary as possible.
DESCRIPTION
ATTRIBUTES
regex
-
The compiled regex
re (ArrayRef)
-
The strings to compile the regular expression from
whole (Bool)
-
Makes sure each element of
re
is matched as a whole word all (Bool)
-
Makes sure that the elements of
re
are matched in any order (currently only two elements supported) words (Bool)
-
Match each word separated by arbitrary number of characters (default separation is one space)
ignore_case (Bool)
-
Ignore case in the final regex
files (HashRef)
-
Stores a count of matches in each file
current_file
-
Reference to the current file being searched
current_count (Int)
-
The number of matches found in the currently searched file
sub_matches (ArrayRef[Str])
-
Terms to search on that the file should also contain to be considered to have matched
sub_match (Bool)
-
Stores if a sub match has been found
sub_not_matches (ArrayRef[Str])
-
Terms to search on that the file should not contain to be considered to have matched
sub_not_match (Bool)
-
Stores if a not sub match has been found
last (ArrayRef[Str])
-
A list of types to keep track of for context of a match (eg the last function, class or sub)
lasts (HashRef[Str])
-
The current state of requested "last" types
smart (Bool)
-
Create smart regular expression
SUBROUTINES/METHODS
make_regex ()
match ($line)
sub_matches ($line)
reset_file ( $file )
Resets file based counters and adds $file as the new file being processed
check_sub_matches ( $line )
Checks that $line matches any specified sub matches
check_lasts ( $line )
Checks if the line matches a block start signature eg checks if we are starting a sub, function or class so that any matches in that block can be identified as coming from there.
get_last_found ()
Returns the last match block
DIAGNOSTICS
CONFIGURATION AND ENVIRONMENT
DEPENDENCIES
INCOMPATIBILITIES
BUGS AND LIMITATIONS
There are no known bugs in this module.
Please report problems to Ivan Wills (ivan.wills@gmail.com).
Patches are welcome.
AUTHOR
Ivan Wills - (ivan.wills@gmail.com)
LICENSE AND COPYRIGHT
Copyright (c) 2009 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.