Project

General

Profile

Bug #4087

closed

Unknown modifiers in regular expressions should be ignored

Added by westor (GR) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Scripting
Target version:
Start date:
08/21/2018
Due date:
% Done:

0%

Estimated time:
Operative System:
All
Regression:
No

Description

Hello,

There is a bug, when i use a specific PCRE pattern to match IPV6 addreses on AdiIRC seems to be broken in some cases, it doesn't match in some cases as it should, i will provide an example with an attached data file to test.

I don't know if AdiIRC PCRE version play a role here, as it was tested in 8.2 and matched all the cases.

Example Code:

alias reg_test {
  var %f = lala.txt
  var %p = /(fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])\.{3,3})(25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])\.{3,3})(25[0-5]|2[0-4][0-9]|1{0,1}[0-9]{0,1}[0-9])|:((:[0-9a-fA-F]{1,4}){1,7}|:))/iD
  var %t = $lines(%f)
  var %i = 1
  while (%i <= %t) { 
    if ($regex($read(%f,n,%i),%p)) { echo -a IS: $readn -> $read(%f,n,%i) } 
    inc %i
  }
}

- Thanks!


Files

lala.txt (3.64 KB) lala.txt westor (GR), 08/21/2018 10:25 PM
#1

Updated by Per Amundsen over 3 years ago

  • Subject changed from AdiIRC seems broken in some regex situations to Unknown modifiers in regular expressions should be ignored
  • Status changed from New to Resolved

The problem is the /D modifier, it is not supported in AdiIRC, it is also not necessary in this regex so not sure why it is used.

The second problem is that all unknown modifiers should be ignored.

#2

Updated by Per Amundsen over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF