Thanks everyone .. I got it working.

Felice

-----Original Message-----
From: Castro, Edwin Gabriel (Firing Systems Engr.)
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 08, 2004 1:09 PM
To: Felice Vittoria; Nant-Users (E-mail)
Subject: RE: [Nant-users] regex help


Try something like this: pattern="(?'version'(\d+\.){3}\d+)"

That will get the entire version number. If you need more fine-grained
extraction you could try:

pattern="(?'major'\d+)\.(?'minor'\d+)\.(?'build'\d+)\.(?'revision'\d+)"

Of course, you should use whatever names make sense to your development
environment. In both cases you will match one or more digits followed by
a period three times and lastly one or more digits.

If you need to distinguish between that line and other similar lines
then you may need more context like:

pattern=" TEST_VERSION .*(?'version'(\d+\.){3}\d+)"

Here you match a space, followed by the string TEST_VERSION, followed by
another space, followed by zero or more characters, followed by the
version number. This last expression will not match lines that do not
contain TEST_VERSION in it.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:nant-users-
> [EMAIL PROTECTED] On Behalf Of Felice Vittoria
> Sent: Wednesday, December 08, 2004 9:14 AM
> To: Nant-Users (E-mail)
> Subject: [Nant-users] regex help
> 
> Hey guys/gals,
> 
> I'm using the regex task.   This is more of a regular expression
syntax
> more of Nant's usage.   I have the following string in one of my
files:
> 
> Public Const TEST_VERSION As String = "Test Program 1.0.0.1"
> 
> What do I enter for regex's pattern attribute so that I can get the
value
> 1.0.0.1 ?
> 
> Thanks,
> Felice
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to