Re: RegExp Help
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: RegExp Help

From: Donald Arseneau <asnd@triumf.ca>
Date: Sat May 28 2005 - 06:03:21 CEST

"wxforecaster" <Evan.Bookbinder@noaa.gov> writes:

> I need the expression to begin with a new line character and then a
> period, followed by all text until it hits the following sequence of
> characters: capital letter, capital letter, capital letter, number,
> number, number.

Do you want the match to return
a) the all-text-until?
b) the newline-dot and all-text-until?
c) everything, including the AAA000?

> I've tried things like {(\n\.)[^[A-Z][A-Z][A-Z][0-9][0-9][0-9]]+} but
> to no avail.

Your nested [[]] make no sense. It looks like you were trying to make
a lookahead-assertion.
You are capturing the fixed sub-expression \n\., though I can't believe
you want to assign it to a variable!

It looks like you want option b)

 {\n\..*(?=[A-Z]{3}[0-9]{3})}

-- 
Donald Arseneau                          asnd@triumf.ca
Received on Thu Sep 29 14:19:33 2005