Skip to main content
Question

stringsearcher to feature

  • November 21, 2016
  • 2 replies
  • 52 views

I have a feature class, and one of the fields is "tag". In the tag there are different slices of information stuffed. I need to get the next part: "addr:street"=>"East 79th Street".

The first part "addr:street"=> is always the same, it is the second part that differents every time.

I tried to use the "StringSearcher", Search In: "tag", Regular Expression: "addr:street"=>"([a-zA-Z0-9]+)".

But I now get no matches at all.

Is there anyone who can help me?

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.

2 replies

takashi
Celebrity
  • November 21, 2016

Hi @remcohofs, I think the character class in the regex should contain the white space.

Alternatively, the AttributeSplitter (Delimiter or Format String: =>) might also be helpful in this case.


mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • November 21, 2016

If it is ALWAYS the first part, then I would use the SubstringExtractor. Set the Start Index parameter to 17 (the first character after the third ") and the End Index to -2 (the character before the final ")

That will give you the East 79th Street part, without quotes around it. If you wanted the quotes, then use 16 and -1 instead.

It's more hard-coded than a regular expression, but if the first part is always the same this way is much quicker to set up.