IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

split address field Options · View
bvleer1962
Posted: Tuesday, May 14, 2019 1:06:44 PM
Rank: Newbie

Joined: 5/14/2019
Posts: 1
Hi, I want to split my address field which contains streetname, number, and extension in 1 field. For example: Highway 10 b
So I want to split this field in minimum 2, maximum 3 fields. (Streetname and number Always available, extension not Always).
Apparantly this xpath should do it:

/^(.+) ((?i)[\d]+[\da-z-]*)$|^((?i)[\d]+[\da-z-]*), (.+)$/

But when entering this in te tokenize-regexp function I ge a syntax error on the syntax of this expression?

Questions:

What is wrong with the syntax?
What is the best way to achieve my goal? Is this the tokenize-regexp function?


K101
Posted: Wednesday, May 15, 2019 11:58:54 AM
Rank: Advanced Member

Joined: 2/27/2009
Posts: 558
That's not XPath, it's a regular expression. XPath's regular expression engine doesn't offer all the features of other engines you might be used to. Indeed, it looks like the mode modifiers which are the (?) syntax you're using aren't supported in XPath. So, that's what's wrong with the syntax.

As to the best way to achieve your goal, obviously some substring functions could do it if you find the right logic. The tokenize-regexp function is the same, it might work if you find the right expression.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.