Ticket #73 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Empty captures issue in microregex

Reported by: mooneer Owned by: mooneer
Priority: major Milestone:
Component: microregex Version: 1.0b6
Keywords: Cc:

Description

Example:

import "System.regex";

txt = "http://kite-language.org/docs/kdoc-1.0b8/interface.http.html http://www.google.com/ http://random.com:8080/";

url_rgx = make System.regex("http://([^/: ]+)(:([0-9]+))?(/[^ ]*)?");                                   
rgx_result = url_rgx|match(txt);
while(not (rgx_result is System.null)) [
    rgx_result.captures|print;
    rgx_result = url_rgx|match(txt, rgx_result.match_begin + rgx_result.match_length);
];

Intended result:

[http://kite-language.org/docs/kdoc-1.0b8/interface.http.html, kite-language.org, , , /docs/kdoc-1.0b8/interface.http.html]
[http://www.google.com/, www.google.com, , , /]
[http://random.com:8080/, random.com, :8080, 8080, /]

Actual result:

[http://kite-language.org/docs/kdoc-1.0b8/interface.http.html, kite-language.org, , , , /docs/kdoc-1.0b8/interface.http.html]
[http://www.google.com/, www.google.com, , , , /]
[http://random.com:8080/, random.com, :8080, 8080, /]

Change History

comment:1 Changed 3 years ago by mooneer

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r482, but should see if there are side-effects.

Note: See TracTickets for help on using tickets.