This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bash in process regular expressions


Hi, when I write a bash script using regular
expressions something goes wrong with the single
quotes that I do understand should surround the
regular expression. The code I show below works okay
when the single quotes are removed, but it does not as
shown. For this example the single quotes are not
really needed but is useful for showing my problem, my
real script does need the single quotes because I'm
trying to match several sub-expressions.

any help is appreciated,
thanks,
 Rodrigo

#!/bin/bash
if [[ hola =~ '(.*)' ]]
then
  echo ${BASH_REMATCH[1]}
else
  echo arghhh
fi
 


 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]