Opened 22 months ago

Last modified 21 months ago

#78 new defect

Regular expression engine won't properly match beginning of lines

Reported by: mrwarper Owned by:
Priority: major Milestone: Release_1.1
Component: eFTE core Version: Release_1.0
Keywords: Regular expression, regex, line anchoring Cc: mrwarper, abwillis

Description

Regular expression anchoring for beginning of line fails, apparently since 2008.

Finding "^$" as a regular expression should match empty lines (it does in FTE/2006) but in eFTE2 (also FTE/2008) it fails and instead matches lines that are 1-character long.

Also, "^." should match the first character of every non-empty line, but matches the second one instead.

Change History (6)

comment:1 Changed 22 months ago by mrwarper

  • Keywords expression line anchoring added; expreesion empty lines removed

comment:2 Changed 22 months ago by mrwarper

  • Cc mrwarper added

comment:3 follow-up: Changed 22 months ago by abwillis

  • Cc abwillis added
Using Find and selecting regexp and putting in "^$" without the quotes[[BR]]
does not appear find anything here.
Create fold by regexp and putting in "^$" does create folds at each blank[[BR]]
line here.
For some reason I had to use code blocks to get the ^ to show.
Last edited 22 months ago by abwillis (previous) (diff)

comment:4 in reply to: ↑ 3 Changed 22 months ago by mrwarper

Replying to abwillis:

Using Find and selecting regexp and putting in "^$" without the quotes
does not appear find anything here.

Exactly. It works in FTE/2006.

Create fold by regexp and putting in "^$" does create folds at each blank
line here.

Which is very interesting -- maybe it's not the regexp engine that got broken but perhaps how it's used internally.

For some reason I had to use code blocks to get the ^ to show.

Took me a while to figure out when I first posted here. It's the goddamn wiki parser assuming everything is non-literal.

If you read http://trac.netlabs.org/efte/wiki/WikiFormatting carefully you'll see at some point:

Notes: [...] ! tells wiki parser to not take the following characters as wiki format [...]

comment:5 Changed 21 months ago by gyoung

What are the file dates for the 2006 and 2008 fte.exe?

comment:6 Changed 21 months ago by mrwarper

FTE/2006 has timestamp 26/01/06, 18:35, is 472496 bytes long, and can be downloaded from http://hobbes.nmsu.edu/download/pub/os2/apps/editors/fte20060126.zip

FTE/2008 has timestamp 04/02/08, 20:51, is 468320 bytes long, and can be downloaded from
http://hobbes.nmsu.edu/download/pub/os2/apps/editors/fte-03-02-08.zip

Note: See TracTickets for help on using tickets.