develooper Front page | perl.perl6.language | Postings from April 2001

Regexp::Func (Re: YA string concat proposal)

Thread Previous
From:
Nathan Wiger
Date:
April 24, 2001 15:41
Subject:
Regexp::Func (Re: YA string concat proposal)
Message ID:
3AE60101.C81BFD44@west.sun.com
"Stephen P. Potter" wrote:
> 
> Oh, and since it hasn't been mentioned for awhile, I'd still prefer if =~
> and !~ went away and were replaced by match(string, [pattern], options),
> replace(string, [pattern], options) and trans(string, ["pattern"], options)
> or some such.  This is one place where I think PHP had a really good idea,
> but missed the mark a little.  ereg_* and eregi_* and preg_* and pregi_*,
> ugghhh...

I'm working on Regexp::Func in another vi window that does this very
thing right now. Although, the syntax I'm working with is a little
different from what you describe above:

   $result = match /pat/flags, $strings ...;
   $result = replace /from/to/flags, $strings ...;
   $result = trade /from/to/, $strings ...;

The advantage to this syntax is you can do whole lists inline. See also
RFC 164. Suggestions welcome, and anyone wanting to test this *very*
welcome (off-list is probably best, this is OT).

-Nate

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About