[Xmltask-users] Using regexp properties
Brought to you by:
bagnew
From: Phil J. <Phi...@do...> - 2011-01-06 11:52:54
|
Hi all, I have been using the following to pull out the commit message from an svn log (comparison.tag.xml) and return the version deployed from the message. This was done by taking the message "Deployed ###.###.###" and replacing the "Deployed " with nothing. <xmltask source="comparison.tag.xml"> <regexp path="log/logentry/msg/text()" pattern="Deployed " replace=""/> <copy path="log/logentry/msg/text()" property="comparison.tag"/> </xmltask> However, there's been a few changes and the message doesn't necessarily start "Deployed " any more, but will contain the version somewhere in the string. I was thinking I could use properties= rather than replace= and pull out just the version number. Using one of the regular expression testers online my regular expression of \b\d{1,3}\.\d{1,3}\.\d{1,3}\b returns just the version when I pass a string of "Deployed 002.000.000" to it. However, my regular expression in xmltask returns; Failed to match property value in 'Deployed 002.158.000' using '\b\d{1,3}\.\d{1,3}\.\d{1,3}\b' My xmltask code for the above; <xmltask source="comparison.tag.xml"> <regexp path="log/logentry/msg/text()" pattern="\b\d{1,3}\.\d{1,3}\.\d{1,3}\b" property="my.version"/> </xmltask> Any idea what I'm doing wrong? I'm using xmltask 1.16.1. Kind Regards, Phil Philip Jeary Build and Deployment Manager Dovetail Services d +44 (0) 1795 414 563 t +44 (0) 844 815 0855 f +44 (0) 844 815 0866 phi...@do... <mailto:phi...@do...> www.dovetailservices.com <http://www.dovetailservices.com> Dovetail. Subscriptions marketing and fulfilment ______________________________________________________________________ This email (and any attachments) is confidential and may contain personal opinions which are not the views of Dovetail Services (UK) Limited unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that: * Dovetail Services (UK) Limited monitors all emails sent or received, any further communication will signify your consent to this. Dovetail Services (UK) Ltd Registered in England and Wales Number 5412224 ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |