Regexp::Common::whitespace(3pm)

Regexp::Common::whitespace3pm

Usage

    use Regexp::Common qw /whitespace/;
    while (<>) {
        s/$RE{ws}{crop}//g;           # Delete surrounding whitespace
    }

Overview

Please consult the manual of Regexp::Common for a general description of the works of this interface.

Do not use this module directly, but load it via Regexp::Common.

"$RE{ws}{crop}"

Returns a pattern that identifies leading or trailing whitespace.

For example:

        $str =~ s/$RE{ws}{crop}//g;     # Delete surrounding whitespace

The call:

        $RE{ws}{crop}->subs($str);

is optimized (but probably still slower than doing the s///g explicitly).

This pattern does not capture under "-keep".

Maintenance

This package is maintained by Abigail ([email protected]).

Bugs and irritations

Bound to be plenty.

For a start, there are many common regexes missing. Send them in to [email protected].

Releases

12 releases since Debian 3.1 (Sarge); the text changed 10 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9
  8. 10–11
  9. 12
  10. 13
  11. Arch

Author

Damian Conway ([email protected])

From perl-regexp-common 2024080801-4 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.