Page 1 of 1
regex in replacement matrix
Posted: Sun Jul 21, 2013 8:26 am
by hopalongrock
I created one for "x" as multiplication sign, as replace ([0-9]) X ([0-9]) with \1 x \2 , and it works well with "custom case" defaulting to "proper case", but only if I disable "use case". For example it results 21 x 435 without use case, but 21 X 435 with use case.
Would it possible to add a new setting to the replacement matrix item, to eliminate the "use case" conversion on the result.
Another solution could be some extension of the "Exceptions", allowing not only literals before ";" .
I think replacement matrix and "Exceptions" are similar, the latter is simpler but don't use case rules.
Re: regex in replacement matrix
Posted: Sun Jul 21, 2013 6:53 pm
by jtclipper
Case conversion comes after matrix execution.
I'm thinking about adding an extra option per matrix, to execute it before or after case.
Re: regex in replacement matrix
Posted: Mon Jul 22, 2013 5:09 am
by hopalongrock
jtclipper wrote:Case conversion comes after matrix execution.
Yes, that's the problem in this case.
jtclipper wrote:I'm thinking about adding an extra option per matrix, to execute it before or after case.
It would be great, thanks in advance.
Re: regex in replacement matrix
Posted: Mon Jul 22, 2013 7:25 pm
by jtclipper
Updated the beta.
Re: regex in replacement matrix
Posted: Tue Jul 23, 2013 5:35 am
by hopalongrock
Works fine !
However, when I try to add a second rule, I get " Invalid cell' at 1st, later "list index" errors, and can't save the rule.

- Invalid cell.jpg (35.71 KiB) Viewed 9916 times

- List index.jpg (32.94 KiB) Viewed 9916 times
Edit:
In effect,I am unable to add any new rule:

- any new invalid.jpg (46.03 KiB) Viewed 9916 times
Re: regex in replacement matrix
Posted: Tue Jul 23, 2013 6:37 pm
by jtclipper
Thanks, fixed that
(There are some unfinished proper case changes in there)
Re: regex in replacement matrix
Posted: Tue Jul 23, 2013 8:06 pm
by hopalongrock
Works fine with the new beta, thanks !
Re: regex in replacement matrix
Posted: Tue Jul 23, 2013 8:29 pm
by jtclipper
Did another update yet, proper case option (comment field separators) should work ok.
Re: regex in replacement matrix
Posted: Tue Jul 23, 2013 9:17 pm
by hopalongrock
jtclipper wrote:Did another update yet, proper case option (comment field separators) should work ok.
Sorry, I write the comments myself, and use "as is" with custom case for comments, so I don't know, what was the problem.