On Thu, Mar 05, 2015 at 05:26:00PM +0000, 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'.
Good to know!

imadev:~$ s='foo bar'; r='\s'; if [[ $s =~ $r ]]; then echo match; fi
imadev:~$ printf '%(%s)T\n' -1
s

wooledg@wooledg:~$ s='foo bar'; r='\s'; if [[ $s =~ $r ]]; then echo match; fi
match
wooledg@wooledg:~$ printf '%(%s)T\n' -1
1425576833

Reply via email to