I just want to get the part in bold and created a Regex to select this part. My idea is to replace the complete string and just keep the string part with the coordinates (bold part).
My Regex: rijksdriehoekX":[0-9]{6}.[0-9]{3},"rijksdriehoekY":[0-9]{6}.[0-9]{3}
Any ideas how to solve this issue?
Best answer by hkingsbury
Thanks @hkingsbury ! The regex works perfect. I have filtered now all records which contain coordinate values.
However, I still need to subtract these coordinates from the string per record and turn them into attribute values in such a way they can be used in a VertexCreator. Do you have any suggestions? 😃
My goal, using the example above, get finally 2 columns with x and y coordinates.
A small change to the regex can achieve that, adding two extra capture groups around the coords
make sure you set the subexpression list name under advanced in the stringsearcher
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
adding a capture group around the whole statement "(...)"
switch [0-9] to \d
escaped '.'. In regex a '.' means any character. by escaping it with a '\' you will only match a '.'
to extract that match, use a StringSearcher. It there is a match it will come out on the '_first_match' attribute
One thing I did note, are your coordinates always going to be 6 long followed by 3dp? you may want to look at adding a range, especaily for the decimal places. {1,3} will match 1 to 3 numbers long
adding a capture group around the whole statement "(...)"
switch [0-9] to \d
escaped '.'. In regex a '.' means any character. by escaping it with a '\' you will only match a '.'
to extract that match, use a StringSearcher. It there is a match it will come out on the '_first_match' attribute
One thing I did note, are your coordinates always going to be 6 long followed by 3dp? you may want to look at adding a range, especaily for the decimal places. {1,3} will match 1 to 3 numbers long
Thanks @hkingsbury ! The regex works perfect. I have filtered now all records which contain coordinate values.
However, I still need to subtract these coordinates from the string per record and turn them into attribute values in such a way they can be used in a VertexCreator. Do you have any suggestions? 😃
My goal, using the example above, get finally 2 columns with x and y coordinates.
Thanks @hkingsbury ! The regex works perfect. I have filtered now all records which contain coordinate values.
However, I still need to subtract these coordinates from the string per record and turn them into attribute values in such a way they can be used in a VertexCreator. Do you have any suggestions? 😃
My goal, using the example above, get finally 2 columns with x and y coordinates.
A small change to the regex can achieve that, adding two extra capture groups around the coords