[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Conditional Regexp matching problem in 3.2
From: |
rew |
Subject: |
Conditional Regexp matching problem in 3.2 |
Date: |
Fri, 19 Jan 2007 00:56:03 -0600 (CST) |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2
uname output: Linux kansas 2.4.18-26.7.x #1 Mon Feb 24 10:15:02 EST 2003 i686
unknown
Machine Type: i686-pc-linux-gnu
Bash Version: 3.2
Patch Level: 0
Release Status: release
Description:
A simple regexp match using =~ inside [[ ]] works on 3.0.16
and 3.1 versions of bash, but doesn't in 3.2.
In pre-3.2 versions, the script in "Repeat-By" (below)
produces one line of output: "Dog 01 is Wiggles". In 3.2, the
regexp no longer matches, so it produces nothing.
Repeat-By:
# run this, eh?
DOG="Dog name - 01 - Wiggles"
if [[ $DOG =~ "([[:alpha:][:blank:]]*)- ([[:digit:]]*) - (.*)$" ]]
then
echo Dog ${BASH_REMATCH[2]} is ${BASH_REMATCH[3]}
fi
Fix:
[Description of how to fix the problem. If you don't know a
fix for the problem, don't include this section.]
- Conditional Regexp matching problem in 3.2,
rew <=