1Regexp::Common::whitespUasceer(3C)ontributed Perl DocumeRnetgaetxipo:n:Common::whitespace(3)
2
3
4
6 Regexp::Common::whitespace -- provides a regex for leading or trailing
7 whitescape
8
10 use Regexp::Common qw /whitespace/;
11
12 while (<>) {
13 s/$RE{ws}{crop}//g; # Delete surrounding whitespace
14 }
15
17 Please consult the manual of Regexp::Common for a general description
18 of the works of this interface.
19
20 Do not use this module directly, but load it via Regexp::Common.
21
22 $RE{ws}{crop}
23 Returns a pattern that identifies leading or trailing whitespace.
24
25 For example:
26
27 $str =~ s/$RE{ws}{crop}//g; # Delete surrounding whitespace
28
29 The call:
30
31 $RE{ws}{crop}->subs($str);
32
33 is optimized (but probably still slower than doing the s///g
34 explicitly).
35
36 This pattern does not capture under "-keep".
37
39 Regexp::Common for a general description of how to use this interface.
40
42 Damian Conway (damian@conway.org)
43
45 This package is maintained by Abigail (regexp-common@abigail.be).
46
48 Bound to be plenty.
49
50 For a start, there are many common regexes missing. Send them in to
51 regexp-common@abigail.be.
52
54 This software is Copyright (c) 2001 - 2017, Damian Conway and Abigail.
55
56 This module is free software, and maybe used under any of the following
57 licenses:
58
59 1) The Perl Artistic License. See the file COPYRIGHT.AL.
60 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.
61 3) The BSD License. See the file COPYRIGHT.BSD.
62 4) The MIT License. See the file COPYRIGHT.MIT.
63
64
65
66perl v5.28.1 2017-06-02 Regexp::Common::whitespace(3)