Modify ↓
Opened 3 years ago
Last modified 3 years ago
#3922 assigned Bug
Problems with ".+" and ".+?" in regular expressions
| Reported by: | aacn | Owned by: | Jon |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.14.5 | Severity: | None |
| Keywords: | Cc: |
Description
My English is not good, please forgive me, I have to use google translate.
Local $sString = 'ABC' For $i = 1 To 999999 $sString &= 'xxxxxxxxxx' Next $sString &= 'xxxxxxxx' ;Here if you add 1 or more characters, the following expressions use .+? No match, but .+ can match $sString &= 'DEF' For $i = 1 To 999999 $sString &= 'xxxxxxxxxx' Next $sString &= 'xxxx' ;Here if you add 1 or more characters, the following expressions use .+ No match, but .+? can match ;~ Local $aRegExp = StringRegExp($sString, 'ABC.+DEF', 1) Local $aRegExp = StringRegExp($sString, 'ABC.+?DEF', 1) If Not @error Then MsgBox(64, StringLen($aRegExp[0]), StringLen($sString) - StringLen($aRegExp[0])) Else MsgBox(48, '', 'no match') EndIf
It looks like this problem occurs when it is longer than about 10 megabytes.
Attachments (0)
Change History (2)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.

Hi all, it seems that one description should be changed, the last 10 megabytes should be the "length".
When the front part of the string exceeds this length, or the latter part exceeds this length, it will affect the matching of .+ and .+? respectively.