[tcljava-user] jacl 1.3.1 regexp
Brought to you by:
mdejong
From: Johannes K. <joh...@kl...> - 2007-04-09 12:32:48
|
Hi all, I look for a way to parse an XML-File in IBMs wsadmin, which uses jacl 1.3.1 as a scripting language. I found a project called sa4was [1] on IBMs developerworks which does parsing XML with regexp. sa4was works with WebSpher 5.x (which used jacl 1.2.x) however in WebSphere 6.0 (which uses jacl 1.3.1) it doesn't work anymore. Some code in sa4was does the following: ============================================ while {[regexp {([^=]+)="([^"]*?)"(.*)} $restOfTag dontCare attributeName attributeValue restOfTag]} { if {$attributeName == "id"} { set idValue $attributeValue break } } ============================================ and there I get the error "couldn't compile regular expression pattern: nested *?+" I found out that regexp changed in jacl 1.3.1 and non-greedy regexp (with this "*?" expression) doesn't work anymore. Is that right? Questions: a) So are there workarounds for something like that? b) Or are there some better ways to parse XML in jacl? Any help would be appreciated!! best regards, Johannes Links: 1: http://www.alphaworks.ibm.com/tech/sa4was |