Hello.
Please CC my email to answers as I'm not subscribed to the list.
I have problems using =~ operator. I've tried to search for answer, but
failed. I'm using GNU bash, version 3.1.17. Can anybody give me some
examples of usage?
I really do not understand why
$ [[ string =~ [a-z] ]] echo
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/share/locale'
Peter Volkov [EMAIL PROTECTED] wrote:
$ [[ string =~ [a-z] ]] echo something
something
[a-z] matches only one charater, but the pattern is not required to
match against the entire string. You can force it to match the whole
string by using ^ to anchor the pattern to the beginning of the
On 5/21/06, Peter Volkov [EMAIL PROTECTED] wrote:
I have problems using =~ operator. I've tried to search for answer, but
failed. I'm using GNU bash, version 3.1.17. Can anybody give me some
examples of usage?
I really do not understand why
$ [[ string =~ [a-z] ]] echo something
something
Peter Volkov wrote:
Hello.
Please CC my email to answers as I'm not subscribed to the list.
I have problems using =~ operator. I've tried to search for answer, but
failed. I'm using GNU bash, version 3.1.17. Can anybody give me some
examples of usage?
I really do not understand why
Paul Jarc wrote:
Peter Volkov [EMAIL PROTECTED] wrote:
$ [[ string =~ [a-z] ]] echo something
something
[a-z] matches only one charater, but the pattern is not required to
match against the entire string. You can force it to match the whole
string by using ^ to anchor the pattern to the
Andrew Stitt wrote:
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'
Chet Ramey wrote:
Peter Volkov wrote:
Please CC my email to answers as I'm not subscribed to the list.
$ [[ string =~ [a-z] ]] echo something
something
...
The real question is whether or not quoting the pattern should work as
it does with other [[ pattern matching operators, which is
Bob Proulx wrote:
Chet Ramey wrote:
Peter Volkov wrote:
Please CC my email to answers as I'm not subscribed to the list.
$ [[ string =~ [a-z] ]] echo something
something
...
The real question is whether or not quoting the pattern should work as
it does with other [[ pattern matching
Chet Ramey wrote:
It seems reasonable that quoting any part of the rhs to the =~
operator should cause it to behave in the same manner.
Since the arguments to [[ don't undergo any of the expansions that
require quoting to protect them, there's no reason for =~ to act
differently than the
10 matches
Mail list logo