delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/13/18:25:04

X-Spam-Check-By: sourceware.org
Message-ID: <20070113232442.63884.qmail@web54404.mail.yahoo.com>
X-YMail-OSG: NrNEXpAVM1kBiuX6VTk9SQzPwZiJMJFYdzOU8pi_JajtwLvtx561PAfXwHFGeQ1EL..jujWAmlH1FVOXKKfkvaOuPZUHJwA4IoJH9kSDob2YvBy4SOAQHzNOjdmCsohMdb1bYgyU5VlX7Fw-
Date: Sat, 13 Jan 2007 15:24:42 -0800 (PST)
From: Rodrigo Amestica <ramestica AT yahoo DOT com>
Subject: bash in process regular expressions
To: cygwin AT cygwin DOT com
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019