On Thu, Oct 15, 2009 at 05:03:48PM +0300, Rakotomandimby Mihamina wrote:
> Hello
> I made a simple CGI script, with some forms.
> I would like to
> - remove bad chars from input strings.
> - trim input strings (remove spaces, tabs, newlines,...)
>
> I would like to make some simple replace with simple regexes.
> I saw Str regexes use is simpler (to me) and Pcre probably more powerfull
> but not yet caught (by me).
>
> What would you recommend?
Pcre is a better library, easier to use and more powerful.
However Str has the advantage that it's part of the standard library
and doesn't involve installing anything else. (Installing extra
libraries can be a problem for users on deficient OSes like Windows).
There is also micmatch/mikmatch, which is a very different approach to
the problem:
http://martin.jambon.free.fr/micmatch.htmlRich.
--
Richard Jones
Red Hat