Page 1 of 1

Regular Expression Parsing

Posted: Sun Nov 01, 2020 3:41 pm
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.

Posted: Mon Nov 02, 2020 9:38 am
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

Posted: Mon Nov 02, 2020 1:14 pm
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!