1. regexps

has anyone made a .e doing regular expression matching, substituting, and
translating, just like they're done by grep or sed (and thus perl)?

new topic     » topic index » view message » categorize

2. regexps

[resent due to no reply]
has anyone made a .e doing regular expression matching, substituting, and
translating, just like they're done by grep or sed (and thus perl)?

new topic     » goto parent     » topic index » view message » categorize

3. Re: regexps

At Sun, 5 Jul 1998 17:05:58 EDT, Buddy Hyllberg <budmeister1 at JUNO.COM> wrote:
>wow! a reply ;)

blink

>I'm not exactly sure you want to use them in Euphoria. In Perl, regexps
>are usually used for substitution, matching or comparison:
>
># changes $var to lowercase
>$var = 'Hi there';
>$var =~ tr/A-Z/a-z/;
>
># checks for answer yes (or similar)
>$var = 'yes';
>print "Good job" if $var =~ m/yes/;
>
>
>what exactly did you want to use them for?
>same thing maybe... ;)

That, and more... I want all

??      (one-time matching) syntax: ?PATTERN?
m//     (matching) syntax: m/PATTERN/gimosx
//      (matching) syntax: /PATTERN/gimosx
q//     (single/direct quoting, maybe unnecessary) syntax: q/STRING/
qq//    (double/interpolated quoting, will substitute embedded vars etc)
        syntax: qq/STRING/
qx//    (backquoting: execute, and return stdout) syntax: qx/STRING/
qw//    (list of words, can be simulated quite easily in Euphoria)
        syntax: qw/STRING/
s///    (substitution) syntax: s/PATTERN/REPLACEMENT/egimosx
        e.g. s/do/did/g used on "Can we undo what he does?"
        will give you "Can we undid what he dides?"
tr///   (translation) syntax: tr/SEARCHLIST/REPLACEMENTLIST/cds
y///    (translation) syntax: y/SEARCHLIST/REPLACEMENTLIST/cds

tr/// = y///
m// = //

new topic     » goto parent     » topic index » view message » categorize

4. Re: regexps

On Sat, 4 Jul 1998, Andy Kurnia wrote:

> [resent due to no reply]
> has anyone made a .e doing regular expression matching, substituting, and
> translating, just like they're done by grep or sed (and thus perl)?

Isn't \euphoria\include\wildcard.e useful here.
Granted you'd have to tweak the code a little to get true grep/sed-like
regexes, but there's a firm basis there.

I believe that at the moment is acts like the Un*x command line regexps:

 com*d*.com => command.com
               commodor.com
               etc.

--
Carl R White
E-mail...: cyrek- at -bigfoot.com              / Remove the hyphens before
Finger...: crwhite- at -dcsun1.comp.brad.ac.uk \ mailing or fingering...
Url......: http://www.bigfoot.com/~cyrek/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu