Thank you very much. This is what I thought might be the case. I will probably pursue writing my own custom selector for this task.
Bill -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 10:20 PM To: user@ant.apache.org Subject: AW: containsregexp selector Ant 1.6.5 For catching in several lines you usually have to set a flag ("m" I think). I dont know if you can specify the flag inside the expression. The selector [1] doesnt support specifying flags directly. Jan 0120: if (myRegExp == null) { 0121: myRegExp = new RegularExpression(); 0122: myRegExp.setPattern(userProvidedExpression); 0123: myExpression = myRegExp.getRegexp(getProject()); 0124: } [1] http://cvs.apache.org/viewcvs.cgi/*checkout*/ant/src/main/org/apache/tools/a nt/types/selectors/ContainsRegexpSelector.java?content-type=text%2Fplain >-----Ursprüngliche Nachricht----- >Von: Bill Rich [mailto:[EMAIL PROTECTED] >Gesendet: Freitag, 5. August 2005 07:11 >An: user@ant.apache.org >Betreff: RE: containsregexp selector Ant 1.6.5 > >Thanks Jan, you raise a good point about missing child classes. I don't >have any of them at the moment but I should allow for it. > >But my main question is why does the containsregexp selector miss the >files where there is a line break? Do I need to change something to use >a different regexp implementation of am I just stuck with this anomaly? >I assume that \s means whitespace and that includes the new line. It >seems to work with all other whitespace such as hroizontal tabs. > >Thanks. Bill > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Sent: Thursday, August 04, 2005 9:33 PM >To: user@ant.apache.org; [EMAIL PROTECTED] >Subject: AW: containsregexp selector Ant 1.6.5 > >I would catch only ListResourceBundle, write them to file and have any >eye on them: >- you dont catch imports >- you dont catch childs of childs > public class MyRB extends LRB01 {...} > public class LRB01 extends java.util.ListResourceBundle {...} > >Jan > >>-----Ursprüngliche Nachricht----- >>Von: Bill Rich [mailto:[EMAIL PROTECTED] >>Gesendet: Donnerstag, 4. August 2005 20:13 >>An: 'Ant Users List' >>Betreff: containsregexp selector Ant 1.6.5 >> >>Hi All, >>I am trying to use a fileset to find all the Java ListResourceBundle >>files in a product. I am trying to use the >>following: >> >><fileset id="lrbset" dir="${SOURCEFILESDIR}/${PRODUCT}" >>includes="**/*"> >> <and> >> <filename name="**/*.java"/> >> <or> >> <containsregexp >>expression=".*\s+class\s+[^\s]+\s+extends\s+ListResourceBundle.*"/> >> <containsregexp >>expression=".*\s+class\s+[^\s]+\s+extends\s+java\.util\.ListRes >ourceBundle.*"/> >> </or> >> </and> >></fileset> >> >>Works great if "class", "extends", and "ListResourceBundle" >>are on the same line in a file. If there is a line break in there >>anywhere it does not find the file. >> >>Snippets from some example files: >>1) >><snip> >>public class LRB01 extends java.util.ListResourceBundle implements >>ComponentLetterError { </snip> >> >>2) >><snip> >>public class LRB03 >>extends ListResourceBundle >>{ >></snip> >> >>3) >><snip> >>public class LRB04 extends ListResourceBundle { </snip> >> >>The fileset finds examples 1 and 3 but not example 2. >> >>Any clues as to what to change or how to approach this differently? >> >>tia Bill >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] For >additional >>commands, e-mail: [EMAIL PROTECTED] >> >> > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] For additional >commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]