Skip to main content
Question

stringsearcher to feature

  • November 21, 2016
  • 2 replies
  • 45 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?

2 replies

takashi
Evangelist
  • 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+45
  • 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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings