Regular Expression Parsing

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
Drxenos
Posts: 224
Joined: Mon Jul 07, 2003 8:38 pm

Regular Expression Parsing

Post by Drxenos »

I think somewhere along the way, the parsing for regular expressions broke.

I recently wanted to replace some text with a backslash, followed by an incremented value. I can't seem to get this to work:

\\\i{1,1,2,0}

On a whim, I tried unescaping the backslash, but that didn't work (didn't expect it to):
\\i{1,1,2,0}

This works, but doesn't have the preceding backslash:
\i{1,1,2,0}

I ending up having to do two transformations:
FOO\i{1,1,2,0}

then, replace the FOO with a backslash.


Thanks.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

The juxtaposition of a backslash and a sequence number expression confuses TetPad.

Separate them using parentheses:
\\(\i{1,1,2,0})
or
(\\)\i{1,1,2,0}

See https://forums.textpad.com/viewtopic.php?t=13159
User avatar
Drxenos
Posts: 224
Joined: Mon Jul 07, 2003 8:38 pm

Post by Drxenos »

ben_josephs wrote:The juxtaposition of a backslash and a sequence number expression confuses TetPad.

Separate them using parentheses:
\\(\i{1,1,2,0})
or
(\\)\i{1,1,2,0}

See https://forums.textpad.com/viewtopic.php?t=13159
Thank you!
Post Reply