I've already created such a regex task, which sets properties based on named Groups 
(<?name>).
For example, for the regular expression ^(?<name>\w+):(?<value>\w+), you'd say:

<regex pattern="^(?&lt;name>\w+):(?&lt;value>\w+)" input="Section1:119900"/>
<echo message="${name}"/>
<echo message="${value}"/>

results in:

[echo] Section1
[echo] 119900

Note that you have to use the XML entity &lt; in order to specify a <.

I could send it to the list, or place it somewhere else, if there is interest.

Best,

Arjen

> -----Original Message-----
> From: Scott Hernandez [mailto:[EMAIL PROTECTED]
> Sent: woensdag 12 maart 2003 19:26
> To: Nant-Developers (E-mail)
> Subject: Re: [nant-dev] Substring?
> 
> 
> Yes, none of the tasks I listed exist in NAnt yet.
> 
> Go for it... :)
> 
> ----- Original Message ----- 
> From: "Griffin Caprio" <[EMAIL PROTECTED]>
> 
> 
> > So, are you saying that it doesn't exist yet?
> > 
> > I agree that a generic regex task would be much more
> > useful than a more specific one.  Shall I go ahead and
> > claim the Regular Expression task?
> > 
> > -Griffin
> > --- Scott Hernandez <[EMAIL PROTECTED]> wrote:
> > > Griffin,
> > > 
> > > Yep, something like the ant basename or dirname
> > > task?
> > > 
> > > http://ant.apache.org/manual/CoreTasks/basename.html
> > > http://ant.apache.org/manual/CoreTasks/dirname.html
> > > 
> > > I'd rather see a more generic regex task or
> > > something that can do
> > > string/file/dir ops.
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by:Crypto Challenge is now open! 
> Get cracking and register here for some mind boggling fun and 
> the chance of winning an Apple iPod:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> _______________________________________________
> Nant-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-developers
> 


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to