Jump to content

Writing Regular Expression In Ant ..


Recommended Posts

Posted

Guys, i need some help in writing regular expression for DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01 variable, i am trying to use this is in ANT tool, i need to split this into 2 parts variable1= DEV1_ and variable 2=R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01,
the value of DEV1 might change to dev2 or dev2...but the value of R* wil be same except change in numbers,please let me know i am working on this since 1 week...any help is really appreciated...

Thanks...

  • Replies 35
  • Created
  • Last Reply

Top Posters In This Topic

  • CQ5_DEV

    20

  • tollywoodfan123

    10

  • pikki

    2

  • cherlapalli_jailer

    2

Top Posters In This Topic

Posted

pattern = "/\A(DEV)\d/" - gives DEV1
pattern = "/\A*(R(\S*))/" gives R...

Posted

@[url="http://www.andhrafriends.com/user/32908-cq5-dev/"]CQ5_DEV[/url] avunu bhayya...basical ga aa script server ni differentiate chesukoni code deploy cheyyali...aithe Dev1_ emo server name and the rest R* is the code version....
@[url="http://www.andhrafriends.com/user/31770-guillaume/"]Guillaume[/url] ledu bhayya...adi sure ga ANT build lone add cheyyali....

Posted

[quote name='tollywoodfan123' timestamp='1350661363' post='1302656281']
@[url="http://www.andhrafriends.com/user/32908-cq5-dev/"]CQ5_DEV[/url] avunu bhayya...basical ga aa script server ni differentiate chesukoni code deploy cheyyali...aithe Dev1_ emo server name and the rest R* is the code version....
@[url="http://www.andhrafriends.com/user/31770-guillaume/"]Guillaume[/url] ledu bhayya...adi sure ga ANT build lone add cheyyali....
[/quote]

aithe nenu ichina pattern corresteee...try it

Posted

@[url="http://www.andhrafriends.com/user/32908-cq5-dev/"]CQ5_DEV[/url]

<?xml version="1.0"?>
<project name="TestProject" default="Test">
<property name="build" value="DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01" />

idi script bhayya..so nuvvu cheppidni ekkada add cheyyali...basical ga nenu ant lo work kotha...thanks for your response bhayya....

Posted

[quote name='tollywoodfan123' timestamp='1350661516' post='1302656310']
@[url="http://www.andhrafriends.com/user/32908-cq5-dev/"]CQ5_DEV[/url]

<?xml version="1.0"?>
<project name="TestProject" default="Test">
<property name="build" value="DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01" />

idi script bhayya..so nuvvu cheppidni ekkada add cheyyali...basical ga nenu ant lo work kotha...thanks for your response bhayya....
[/quote]

ant version cheppu

Posted

Apache Ant(TM) version 1.8.4 compiled on May 22 2012

Posted

<property name="build" value="DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01" />
<propertyregex property="var1"
input="${build.value}"
regexp="\A(DEV)\d"
casesensitive="false" />
<propertyregex property="var2"
input="${build.value}"
regexp="\A*(R(\S*))"
casesensitive="false" />

Posted

[quote name='tollywoodfan123' timestamp='1350661516' post='1302656310']
@[url="http://www.andhrafriends.com/user/32908-cq5-dev/"]CQ5_DEV[/url]

<?xml version="1.0"?>
<project name="TestProject" default="Test">
<property name="build" value="DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01" />

idi script bhayya..so nuvvu cheppidni ekkada add cheyyali...[b]basical ga nenu ant lo work kotha[/b]...thanks for your response bhayya....
[/quote]

naku kuda [img]http://2.bp.blogspot.com/-GIadhrrwqV0/T4HY9Q2RB_I/AAAAAAAAC_I/DhrC9waI6Ro/s1600/sunil-maska+GIF.gif[/img]

Posted

<?xml version="1.0"?>
<project name="Sample" default="sample">
<property name="build" value="DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01" />
<propertyregex property="var1"
input="${build.value}"
regexp="\A(DEV)\d"
casesensitive="false" />
<propertyregex property="var2"
input="${build.value}"
regexp="\A*(R(\S*))"
casesensitive="false" />

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\lib\tools.jar
Buildfile: C:\Users\u463440\Downloads\myproject\sample.xml

BUILD FAILED
C:\Users\u463440\Downloads\myproject\sample.xml:2: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Total time: 0 seconds

Posted

[quote name='tollywoodfan123' timestamp='1350662128' post='1302656393']
<?xml version="1.0"?>
<project name="Sample" default="sample">
<property name="build" value="DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01" />
<propertyregex property="var1"
input="${build.value}"
regexp="\A(DEV)\d"
casesensitive="false" />
<propertyregex property="var2"
input="${build.value}"
regexp="\A*(R(\S*))"
casesensitive="false" />

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\lib\tools.jar
Buildfile: C:\Users\u463440\Downloads\myproject\sample.xml

BUILD FAILED
C:\Users\u463440\Downloads\myproject\sample.xml:2: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Total time: 0 seconds
[/quote]
ee line mundu tarvata white spaces unnayi ani tidutundi
sample:xml:2 ante idi line 2 lo undi. line 1 lo whitespace undi. move this to line 1.
<?xml version="1.0"?>

Posted

white spaces thesesa bhayya...
<?xml version="1.0"?>
<project name="Sample" default="sample">
<property name="build" value="DEV1_R2012.08.21.B2012.05.08.01.R2012.08.21.S2012.05.09.01" />
<propertyregex property="var1"
input="${build.value}"
regexp="\A(DEV)\d"
casesensitive="false" />
<propertyregex property="var2"
input="${build.value}"
regexp="\A*(R(\S*))"
casesensitive="false" />
</project>

C:\Users\u463440\Downloads\myproject>ant -f new.xml
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\lib\tools.jar
Buildfile: C:\Users\u463440\Downloads\myproject\new.xml

BUILD FAILED
C:\Users\u463440\Downloads\myproject\new.xml:7: Problem: failed to create task or type propertyregex
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
Total time: 0 seconds

Posted

[quote name='CQ5_DEV' timestamp='1350662327' post='1302656414']
ee line mundu tarvata white spaces unnayi ani tidutundi
sample:xml:2 ante idi line 2 lo undi. line 1 lo whitespace undi. move this to line 1.
<?xml version="1.0"?>
[/quote]

annaya..vachinda? mari nen ellana..[img]http://www.desigifs.com/sites/default/files/SAJANPOKIRI10.gif?1290137507[/img]

×
×
  • Create New...