luweitest:
--------------------------------------------------------------------------------
PSpad 4.5.6 2427
When replacing <c r=".+?"[^>]+?/> ,
<c r="A4" s="24" t="s"><v>17</v></c><c r="B4" s="25"/> was matched instead of my
expectation that only <c r="B4" s="25"/> should be matched. What can I do?
--------------------------------------------------------------------------------


I believe, it is an expected matching behaviour, I guess even the non-greedy
quantifiers don't move the start of the match forward, if a valid match can be
found. (The regex continues to match as early as possible and only the further
extent of the match depends on greedeness.)

You could restrict the likely "attribute" pattern a bit ".+?"
i.e. like
<c r="[^>]+?"[^>]+?/>
<c r="[^>]+?"[^"]+?/>
if it suits your data.
Both of them match as you seem to prefer in this example.

hth,
  vbr

-- 
<http://forum.pspad.com/read.php?2,57502,57503>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem