Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 178009

Summary: app-shells/bash-3.2_p15-r1 regex broken
Product: Gentoo Linux Reporter: Ortwin Glueck <odi>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Ortwin Glueck 2007-05-11 08:28:33 UTC
As of app-shells/bash-3.2_p15-r1 subexpressions in regular expressions are broken. Scripts that worked before now behave erronous.

Reproducible: Always

Steps to Reproduce:
[[ "a b c" =~ "a (.) c" ]]
echo ${BASH_REMATCH[1]}
Actual Results:  
Returns nothing

Expected Results:  
b
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-05-11 08:30:12 UTC
Not really.

*** This bug has been marked as a duplicate of bug 163527 ***
Comment 2 Ortwin Glueck 2007-05-11 08:46:49 UTC
Puh... Quite a nasty change that breaks lots of my scripts.

The new way to write these sort of regex is:
V="a b c"
RE="a (.) c"
[[ $V =~ $RE ]]