PreviousNextTracker indexSee it online !

(65/240) 3382 - Regular expression anomaly

Searching for regular expression ^(\[^:\]+):(\[^:\]+)$ and substituting with ffffffffffffff in the sample below appears to sustitute every second line.

It may be the anchored match?

The same RE in perl substitutes all lines.

zzzstth:x-O1
zzzsttv:x-O2
zzz1th:x-O3
zzz1tv:x-O4
zzz2th:x-O5
zzz2tv:x-O6
zzz3th:x-O7
zzz3tv:x-O8
zzz4th:x-O9
zzz4tv:x-O10

gives
ffffffffffffff
zzzsttv:x-O2
ffffffffffffff
zzz1tv:x-O4
ffffffffffffff
zzz2tv:x-O6
ffffffffffffff
zzz3tv:x-O8
ffffffffffffff
zzz4tv:x-O10

Submitted jnp1234 - 2010-01-27 11:57:47 Assigned k_satoda
Priority 5 Labels editor core
Status open Group normal bug
Resolution remind

Comments

2010-01-27 17:13:12
k_satoda

- **status**: open --> open-duplicate

2010-01-27 17:13:12
k_satoda

This is almost a duplicate of #2915720, which was reported for "^\s.\*$"
and fixed, and will soon released as 4.3.1.
https://sourceforge.net/support/tracker.php?aid=2915720
The problem happened with regexp which starts with "^" followed by any
pattern which matches with a newline character.

However, your test case showed me another surprising behavior. jEdit
doesn't find the last line, which seems likely matches with the pattern.
I'll take another look for this.

2011-12-07 05:24:10
ezust

- **assigned_to**: kpouer --> k_satoda
- **status**: open-duplicate --> open-remind