> Starting at index I, in the direction forward or backward, i want to
> find a substring in form A^n B^m ..
>
> where A in {a,b,c,...,z}, 0<= n<= 1, m >= 1, etc (the exact reqs would
> of course depend on the problem in hand)..
>
I may be wrong, but i think that maxima is not good for such kind of task.
You should probably use PHP (
http://www.phpfreaks.com/tutorial/regular-expressions-part1---basic-syntax
is a good point to start).
Also, you can try sed. (see, for example
http://www.panix.com/~elflord/unix/sed.html)