The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

TITLE

find-variable-length-lookarounds - Find regular expressions that use variable-length lookarounds

SYNOPSIS

 find-variable-length-lookarounds
 find-variable-length-lookarounds --help
 find-variable-length-lookarounds --version

OPTIONS

Option names have been chosen to be compatible (or at least close) to ack.

--break

Asserting this Boolean option causes a blank line to be inserted before the file name in the output.

The default is the inverse of the value of --files-with-matches.

--dump

This option causes the configuration to be dumped. The script then exits.

The configuration consists of the list of ignored directories in effect as of the time the --dump option was encountered.

--files-with-matches

Asserting this option suppresses the listing of individual regular expressions.

The default is --no-files-with-matches, which causes both file name and regular expressions to be listed.

--help

This option displays the documentation for this script. The script then exits.

--ignore-directory

 --ignore-directory=fubar

This option adds a directory to the list of directories to be ignored. It may be specified multiple times. The initial list was cribbed from ack.

-l

This Boolean option is a synonym for --files-with-matches.

--no-ignore-directory

 --no-ignore-directory=fubar

This option removes a directory from the list of directories to be ignored. It is not an error to remove a directory that was not on the list.

--version

This option displays the version of this script. The script then exits.

DETAILS

This Perl script reads Perl files, and finds and displays regular expressions that contain variable-length lookarounds, either lookaheads or lookbehinds. These are defined as lookarounds that contain at least one quantifier. Note that this definition does not catch lookarounds that are variable-length due to current case-folding rules (which, among other things, require ligatures to match non-ligatures, and a German sharp s to match a double s).

The files to analyze are specified on the command line. Directories are traversed recursively, with directories not likely to be of interest being skipped. Only files that appear to be Perl are actually analyzed. These are text files whose names end in .pm, .t, .pl, or .PL, or begin with a shebang line containing 'perl'.

If no files are specified on the command line, the default directory is analyzed.

For each file containing at least one variable-length lookaround, the name of the file is listed. Each regular expression containing a variable-length lookaround is listed, preceded by its line number in the file.

AUTHOR

Thomas R. Wyant, III wyant at cpan dot org

COPYRIGHT AND LICENSE

Copyright (C) 2019-2020 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.

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.