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?
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 565
|
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.
|