Forums

Register new user · Upload a file (image)

Carthago Software forums / Twistpad / Find/Replace issues with regular expressions
Author Message
Eric
Member

Posted: 14 Sep 2013 15:11 | Edited by: Eric


Hi Andre,

I am encountering several issues using Find/Replace with regular expressions enabled.

First problem/example, using the following text:

% -> ForEach-Object
? -> Where-Object

Steps:
1. Ctrl+H
2. Select Regular Expressions checkbox
3. In the Find what field, I enter the following

->.*

4. If I go More -> Highlight All, the appropriate items are selected (-> ForEach... and -> Where...)
5. I leave the Replace with: field blank and click Replace All.

Expected behavior: to be left with only the following

%
?

Current behavior: I am left with the following

% ForEach-Object
? Where-Object

Using "->.*" with regular expresions in other editors (N++, RJ, and TextPad) work as expected.


Second problem/example:

Using the same text as above

1. Ctrl+H
2. Select Regular Expressions checkbox
3. In the Find what field, I enter the following

->.*

The cursor in the Find what: field is blinking after the "*."

4. I click on the icon next to the Find what: field to bring up the regex options. In this case, say I select "End of text \Z" (it really doesn't matter what option is selected).

Expected behavior: for the contents of the Find what: field to show

->.*\Z

Current behavior: I get the following

-\Z>.*

Eric
Member

Posted: 14 Sep 2013 16:39


Ignore the first problem, I forgot to enable the Greedy regular expression option. Second problem is still present.

Andre Santos
Carthago
Moderator


Posted: 15 Sep 2013 07:01


Hi,

There is a known issue with the type of control (ComboBox) in Windows regarding the current cursor position, I'll see if I can find a workaround

Thanks,

André Santos
Carthago Software Support
http://www.carthagosoft.net

Eric
Member

Posted: 15 Sep 2013 07:14


Thanks.