firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.26k stars 199 forks source link

Failure to match three defined characters #2175

Closed hnmcc closed 11 months ago

hnmcc commented 11 months ago

Bug Description

Only the lines starting 'edc' were matched. See attached image:

Regex_possible_issue

No lines were matched if (edc|idc) was replaced with (idc) in the test string.

Reproduction steps

Pattern: (\t)(edc|idc)(_)(white|blackbrown|chartwellgreen|rosewood)(.addEventListener('click',setExternalColour.bind(this,')(white|blackbrown|chartwellgreen|rosewood)('));\n)

Test string: edc_white.addEventListener('click',setExternalColour.bind(this,'white')); edc_blackbrown.addEventListener('click',setExternalColour.bind(this,'blackbrown')); edc_chartwellgreen.addEventListener('click',setExternalColour.bind(this,'chartwellgreen')); edc_rosewood.addEventListener('click',setExternalColour.bind(this,'rosewood')); idc_white.addEventListener('click',setInternalColour.bind(this,'white')); idc_blackbrown.addEventListener('click',setInternalColour.bind(this,'blackbrown')); idc_chartwellgreen.addEventListener('click',setInternalColour.bind(this,'chartwellgreen')); idc_rosewood.addEventListener('click',setInternalColour.bind(this,'rosewood'));

Expected Outcome

All lines should be matches.

Browser

LibreWolf 1190-5

OS

W10 64-bit

hnmcc commented 11 months ago

Lack of attention - sorry!