Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/corion/text-cleanfragment

clean up text to use as URL fragment or filename
https://github.com/corion/text-cleanfragment

Last synced: about 1 month ago
JSON representation

clean up text to use as URL fragment or filename

Awesome Lists containing this project

README

        

DESCRIPTION

This module downgrades strings of text to match

/^[-._A-Za-z0-9]*$/

or, to be more exact

/^([-.A-Za-z0-9]([-._A-Za-z0-9]*[-.A-Za-z0-9])?)?$/

This makes the return values safe to be used as URL fragments
or as file names on many file systems where whitespace
and characters outside of the Latin alphabet are undesired
or problematic.

INSTALLATION

This is a Perl module distribution. It should be installed with whichever
tool you use to manage your installation of Perl, e.g. any of

cpanm .
cpan .
cpanp -i .

Consult http://www.cpan.org/modules/INSTALL.html for further instruction.
Should you wish to install this module manually, the procedure is

perl Makefile.PL
make
make test
make install

REPOSITORY

The public repository of this module is
L.

SUPPORT

The public support forum of this module is
L.

BUG TRACKER

Please report bugs in this module via the RT CPAN bug queue at
L
or via mail to L.

SEE ALSO

L - the C subroutine does something comparable but
does not squish repeating characters and removes dashes.

AUTHOR

Max Maischein C

LICENSE

This module is released under the same terms as Perl itself.

COPYRIGHT (c)

Copyright 2012-2024 by Max Maischein C.