Hi Paul :)

 * Paul Eggert <[EMAIL PROTECTED]> dixit:
> > I would like to know (if you have such information, of course) which
> > 'expr's out there support 'substr' expressions in addition to the
> > GNU coreutils one, of course.
> Sorry, haven't a clue.

    Well, thanks anyway :)

> But you shouldn't need substr: you can always
> get the equivalent by using pattern matching.  E.g., instead of this:
> expr substr "X$string" 3 5
> you use this:
> expr "X$string" : 'X.\(.....\)'

    I thought about using that, but the problem is that I have the
index in a shell parameter. Currently I do:

    expr substr "x$string" $tmpindex 1

    If I need to translate this in a pattern matching expression, I
must calculate the number of 'dots', because I'm not sure if the
'{N}' syntax (to match exactly '{N}' times) is portable enough. I
must assume it is, because that syntax is part of a BRE as specified
by SUSv3 (I don't have access to a POSIX standard so I've chosen SUS
as my standard base).

    Thanks a lot for your help, Paul :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to