First F3 ok, F3 again selects the entire doc!!
-
Reproducing Notepad++ F3 ‘find’ strange behavior
Config:
a. Windows 10 enterprise build:1903
b. Notepad++ v7.9.5 32-bit-
The following regex can find the first matched line correctly:
(?=.?\s(unattach|remove|unplugging|unplug)\s)(?=.?\s(bsod|blue.?screen)\s)(?=.?\s(usb-c|type.?c|usb.?c|usbc|typec)\s).
-
Then press F3 to find next … this time takes an abnormal long time
and it strangely select the entire document after all <------ problem!! -
Try PythonScript on its console by executing this line:
matches=[];editor.research(‘(?=.?\s(unattach|remove|unplugging|unplug)\s)(?=.?\s(bsod|blue.?screen)\s)(?=.?\s(usb-c|type.?c|usb.?c|usbc|typec)\s).’, lambda m: matches.append(m.span(0)));matches
-
Observe the runtime error:
>>> matches=[];editor.research('(?=.*?\s(unattach|remove|unplugging|unplug)\s)(?=.*?\s(bsod|blue.?screen)\s)(?=.*?\s(usb-c|type.?c|usb.?c|usbc|typec)\s).*', lambda m: matches.append(m.span(0)));matches Traceback (most recent call last): File "<console>", line 1, in <module> RuntimeError: The complexity of matching the regular expression exceeded predefined bounds. Try refactoring the regular expression to make each choice made by the state machine unambiguous. This exception is thrown to prevent "eternal" matches that take an indefinite period time to locate.
-
If is really a complexity issue then the behavior should be a message box that indicates the situation.
Sample document that can reproduce the symptom:
1 115 encounters 0x124 BSOD after unplugging 90w USB-C adapter . Keywords: BoW: sit wat c1 adl int sut encounters x124 bsod after unplugging usb adapter platform c1 duckhorn adlstage sibios kbc image win11 home adhoc non adhoc non adhocfail rate out of units out of timesfail units sku4 ks note please refer to the logs on si2 please refer to the memory dmp on ftpftp c1 wat dockhorn x124 user wistroncq qtpsw stctestw acp path only for internal rd ftp rd fordownload ftpdata qt1 uploads snabc14000ks t202110192025 zip 2 116 l show BSoD"INTERNAL_POWER_ERROR" during WB longrun Keywords: BoW: cheetah win11 h2 sut will show bsod internal power error during wb longrun failing system rate machines total machines error rate errors total trials symptom condition reported by jason ni review by michael jin for cheetah sit machine sut will show bsod internal power error during wb longrun problem happens on cheetah test sit machine bios n40et26w ecfw n40et25w mefw preload cheetah windows sit1 please refer to the log about system os info sy 3 796 during Restart and Shutdown Tool with Fan test Keywords: BoW: cheetah w10 sut shows bsod during restart and shutdown tool with fan test failing system rate machines total machines error rate errors total trials symptom condition reported by vivian zhang wistron com for cheetah fvt machine sut shows bsod during restart and shutdown tool with fan test problem happens on cheetah fvt machine bios n40et09w ecfw n40ht09w mefw preload fvt2 fanck tool v1 please refer to the log about system os info system event system info devices status ftp rd fordownload ftpdata qt1 uploads sn03000001 t202102041449 zip error message bsod critical process died recreation procedure power on cheetah fvt machine install fanck tool and restart system open setting file of fanck edit parameter outputcycle to launch agingerz64 exe for bit os after launch click setup button and set the following on test mode select user item on test items check device dmi event acpi select logging on select very long of wait for check on s5 wake item select no cmos setting on external program check enable and enable status logging on external program on mode check wb and cb noticed that the browse file for wb and cb will be enabled on wb browse file locate the fanck bat file located inside the az folder do the same on cb on execute timing select ac close setup window and open setup window check enable box and then set the timer for each pm operation cb sleep after sec wake after sec wb sleep after sec wake after sec close the window prepare the power usb device and attach it to the system connect the powerusb to the power source connect the test system power adapter to the powerusb outlet powerusb device does come with the usb cable connect the usb cable from the power usb to the test system after all cables connected switch the powerusb from off to reset power on the test system go to bios config power enable power on with ac attach make sure the test system is charging as usual click setup pusb button check enable box check s5 ctrl for outlet on the az folder edit the user definitions file for the sequence of pm operation that you want to perform in this case we will perform s5 and restart stress test only locate the for user mode and remove the comments usermode s5 wb save the file click refresh button on main ui to clear previous settings click start button notice system shows bsod critical process died during the longrun test problem refer to bsod jpg log zip detail information sku2 uma nl0100 fan fail at th cycles expected behavior longrun should complete successfully how to recover force shutdown reason why request priority medium or low none problem isolation unique to certain system yes happen on one eut unique to configuration yes happen on one sku unique to os yes happen on w10 os unique to product yes happen on cheetah unique to current version yes happen on bios n40et09w cross product none miscellaneous suspective area sw bios suspective reason sut shows bsod during restart and shutdown tool with fan test level cheetah fvt nl0100 sku2 cpu genuine intel cpu ghz lcd ssd wd gb memory gb sata raid ahci ahci os us jp us preload id and date fvt2 longrun environment switch os to built in administrator account before perform mods s4 longrun with mods supported system switch os to built in administrator account before perform all longruns with az tool disable pm timer disable lock option in shutdown settings disable the option to automatically restart system select kernel memory dump set change user account control settings to never notify install wdtf tool before perform mods longrun confirm there is no yellow mark in device manager connet the powerusb to the power source connect the test system power adapter to the powerusb outlet powerusb device does come with the usb cable connect the usb cable from the power usb to the test system aou port after all cables connected switch the powerusb from off to reset ^^^^^^^ Ctrl+D to repeat this line 50 times to reproduce the problem
-
-
What you’re encountering is likely an overflow of the regular expression engine’s buffers; basically it means that your regular expression (when combined with your data) is too complex to be handled.
I forget exactly which version greater than 7.9.5 implements it, but newer Notepad++ versions have a way to detect and show you that this situation occurred; it looks like this on the user interface:
By the way, the PythonScript RuntimeError that you show was also telling you this, and what you might do to remedy the situation:
RuntimeError: The complexity of matching the regular expression exceeded predefined bounds. Try refactoring the regular expression to make each choice made by the state machine unambiguous. This exception is thrown to prevent "eternal" matches that take an indefinite period time to locate.
-
'(?=.*?\s(unattach|remove|unplugging|unplug)\s)(?=.*?\s(bsod|blue.?screen)\s)(?=.*?\s(usb-c|type.?c|usb.?c|usbc|typec)\s).*'
Looking at your regex that failed, I think I can see that you are working on the problem also discussed HERE.
While I don’t have your data to experiment with, you can maybe help the regex engine not be so burdened by anchoring it to the start of line, i.e., put a
^
in it near the beginning.Perhaps @guy038 would have some other optimizations hints such that simplify your regex so that the engine does not throw an exception?
Another thing I would do if I were you would be to use Python “raw strings” when specifying regexes in the code, e.g. use
r'abc'
instead ofabc
. This will avoid potential trouble with\
characters which are very common in regex. -
@Alan-Kilborn Yes! Notepad++ v8.1.9 has fixed the symptom I saw. Before asking the question I did tried to make an update and then it was still 7.9.5 so I thought that’s the latest. Thank you very much and so glad to find newer versions are good.
-
@Alan-Kilborn Putting a ^ at the beginning of every regex AND’ed sections has reallllllly fixed the complexity problem! thank you sooooo much!!