WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

Regexp UTF-8

View: New views
2 Messages — Rating Filter:   Alert me  

Regexp UTF-8

by Aru :: Rate this Message:

| View Threaded | Show Only this Message

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@...
password  : 123456

--
Thanks
Arun George

--
Thanks
Arun George

Re: Regexp UTF-8

by Arnaud BOURREE :: Rate this Message:

| View Threaded | Show Only this Message

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@...
> password  : 123456
>

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