README
1List::Regexp module
2===================
3
4The module provides a function that builds a regular expression that will
5match any string from the input list of strings. The generated expression
6is much more efficient than the equivalent regexp obtained by mere
7concatenation of all strings from the list with a '|' as separator.
8
9Three kinds of regular expressions can be generated: Perl regexps (the
10default), POSIX extended, and Emacs-style.
11
12Additionally, the generated regexp can be restricted to match whole words
13only, or words appearing on a line alone.
14
15The module is inspired by the GNU Emacs regexp-opt function.
16
17Example of its usage:
18
19 use List::Regexp;
20 my $rx = regexp_opt(@strings);
21 .
22 .
23 .
24 if ($input =~ qr/$rx/) {
25 .
26 .
27 .
28 }
29
30regexp-opt utility
31==================
32
33This utilitiy offers a command line interface to the module. It collects
34its arguments and prints out a regular expression that will match any of
35them. E.g.:
36
37 $ regexp-opt --word string test stringent
38 \<(string(ent)?|test)\>
39
40Copying
41=======
42This package is free software; you can redistribute it and/or modify
43it under the terms of the GNU General Public License as published by
44the Free Software Foundation; either version 3, or (at your option)
45any later version.
46
47See http://www.gnu.org/licenses.
48
49