Hi,
I'm starting to use the oro packages I'd like to use the following code:
The problem is that result is null. Can anyone explain why?
Thanks
org.apache.oro.text.regex.Pattern OROpattern=null;
PatternMatcherInput __content= new PatternMatcherInput("<a
href='http://www.test.com'>test</a>");
PatternMatcher __matcher;
PatternCompiler compiler;
MatchResult result=null;
compiler = new Perl5Compiler();
__matcher = new Perl5Matcher();
try
{
OROpattern = compiler.compile("m#href=#");
}
catch(MalformedPatternException e)
{
System.out.println("Bad pattern.");
System.out.println(e.getMessage());
}
while(__matcher.contains(__content,OROpattern))
{
result = __matcher.getMatch();
System.err.println("result was found");
}
System.err.println("result is "+result);
Ralph Shano
Java Software Developer
OceanLake Inc.
347 Bay St.
Suite 1100
Toronto, Ontario
M5H 2R7
416-203-1677 ext. 309