Re: bash-4.3.33 regexp bug

2015-03-06 Thread Chet Ramey
On 3/6/15 4:35 PM, Stephane Chazelas wrote: > 2015-03-06 11:43:24 -0500, Chet Ramey: >> On 3/5/15 12:36 PM, Greg Wooledge wrote: >>> On Thu, Mar 05, 2015 at 05:26:00PM +, Stephane Chazelas wrote: The bash manual only points to regex(3). So it's down to your system's regex library

Re: bash-4.3.33 regexp bug

2015-03-06 Thread Stephane Chazelas
2015-03-06 11:43:24 -0500, Chet Ramey: > On 3/5/15 12:36 PM, Greg Wooledge wrote: > > On Thu, Mar 05, 2015 at 05:26:00PM +, Stephane Chazelas wrote: > >> The bash manual only points to regex(3). > >> > >> So it's down to your system's regex library (uses > >> regcomp(REG_EXTENDED)) which on rec

Re: bash-4.3.33 regexp bug

2015-03-06 Thread Chet Ramey
On 3/5/15 9:51 AM, Eduardo A. Bustamante López wrote: > On Thu, Mar 05, 2015 at 02:26:48PM +, Jason Vas Dias wrote: >> Good day list, Chet - >> >> I think this is a bug: >> ( set -x ; tab=$'\011'; s="some text: 1.2.3"; >> if [[ "$s" =~ ^some text:[\ $tab]+([0-9.]+) ]]; then >> echo "${B

Re: bash-4.3.33 regexp bug

2015-03-06 Thread Chet Ramey
On 3/5/15 12:36 PM, Greg Wooledge wrote: > On Thu, Mar 05, 2015 at 05:26:00PM +, Stephane Chazelas wrote: >> The bash manual only points to regex(3). >> >> So it's down to your system's regex library (uses >> regcomp(REG_EXTENDED)) which on recent GNU systems supports \s. > > I see. So it's a

Re: bash-4.3.33 regexp bug

2015-03-06 Thread Chet Ramey
On 3/5/15 9:26 AM, Jason Vas Dias wrote: > Good day list, Chet - > > I think this is a bug: > ( set -x ; tab=$'\011'; s="some text: 1.2.3"; > if [[ "$s" =~ ^some text:[\ $tab]+([0-9.]+) ]]; then > echo "${BASH_REMATCH[1]}"; > fi > ) > -bash: syntax error in conditional expression > -bash

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Stephane Chazelas
2015-03-05 12:36:39 -0500, Greg Wooledge: > On Thu, Mar 05, 2015 at 05:26:00PM +, Stephane Chazelas wrote: > > The bash manual only points to regex(3). > > > > So it's down to your system's regex library (uses > > regcomp(REG_EXTENDED)) which on recent GNU systems supports \s. > > I see. So

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Greg Wooledge
On Thu, Mar 05, 2015 at 05:26:00PM +, Stephane Chazelas wrote: > The bash manual only points to regex(3). > > So it's down to your system's regex library (uses > regcomp(REG_EXTENDED)) which on recent GNU systems supports \s. I see. So it's another nonportable feature like printf '%(%s)T'. G

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Stephane Chazelas
2015-03-05 12:14:21 -0500, Greg Wooledge: > On Thu, Mar 05, 2015 at 05:07:44PM +, Stephane Chazelas wrote: > > bash also supports \s, but that's more for [[:space:]] (so > > includes vertical spacing like CR, LF), and you need to use an > > intermediary variable: > > > > r='^some text:\s+([0-9

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Greg Wooledge
On Thu, Mar 05, 2015 at 05:07:44PM +, Stephane Chazelas wrote: > bash also supports \s, but that's more for [[:space:]] (so > includes vertical spacing like CR, LF), and you need to use an > intermediary variable: > > r='^some text:\s+([0-9.]+)' > [[ $s =~ $r ]] Woah! What? Where is *that*

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Stephane Chazelas
2015-03-05 14:26:48 +, Jason Vas Dias: > Good day list, Chet - > > I think this is a bug: > ( set -x ; tab=$'\011'; s="some text: 1.2.3"; > if [[ "$s" =~ ^some text:[\ $tab]+([0-9.]+) ]]; then > echo "${BASH_REMATCH[1]}"; > fi > ) > -bash: syntax error in conditional expression > -ba

Re: bash-4.3.33 regexp bug

2015-03-05 Thread Eduardo A . Bustamante López
On Thu, Mar 05, 2015 at 02:26:48PM +, Jason Vas Dias wrote: > Good day list, Chet - > > I think this is a bug: > ( set -x ; tab=$'\011'; s="some text: 1.2.3"; > if [[ "$s" =~ ^some text:[\ $tab]+([0-9.]+) ]]; then > echo "${BASH_REMATCH[1]}"; > fi > ) > -bash: syntax error in conditi