You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-user@jakarta.apache.org by Arun <ar...@gmail.com> on 2007/10/05 21:46:59 UTC

Regexp UTF-8

Hi,

I was using some hardcoded values for testing the pattern, but when I used
the actual input file, the pattern fails to match.
Please help. The program is for generating insert statement for another
table since my old table column name has changed.This java
program is the migration tool. I have attached the code and the regexp
match. Basically it matches for  (<T_CATALOG_ITEM>)(.*?)(<T
_CATALOG_ITEM>). The program TableMigrator reads an xml file
catalog.xmlfile and matches it with this pattern.
I have also added the files in 4shared.com as z1.zip. Please help
username : arunxgeorgex09@gmail.com
password  : 123456

-- 
Thanks
Arun George

-- 
Thanks
Arun George

Re: Regexp UTF-8

Posted by Arnaud Bourree <ar...@gemalto.com>.
Your input file is in xml format, why don't you use Xpath:

// from http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/xpath/package-summary.html

XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "/T_CATALOG_ITEM";
InputSource inputSource = new InputSource("catalog.xml");
NodeSet nodes = (NodeSet) xpath.evaluate(expression, inputSource, XPathConstants.NODESET);

Regards,


Arnaud.

Arun wrote on 05/10/2007 21:46:
> Hi,
> 
> I was using some hardcoded values for testing the pattern, but when I used
> the actual input file, the pattern fails to match.
> Please help. The program is for generating insert statement for another
> table since my old table column name has changed.This java
> program is the migration tool. I have attached the code and the regexp
> match. Basically it matches for  (<T_CATALOG_ITEM>)(.*?)(<T
> _CATALOG_ITEM>). The program TableMigrator reads an xml file
> catalog.xmlfile and matches it with this pattern.
> I have also added the files in 4shared.com as z1.zip. Please help
> username : arunxgeorgex09@gmail.com
> password  : 123456
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: regexp-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: regexp-user-help@jakarta.apache.org