Hello,
I want to find a regex with python caller.
The text_line is like Híd neve: Líra utca - gyalogos híd. And I want to get only: Líra utca - gyalogos híd
I was able to do it with StringSearcher, where the expression for the regex was like : (?<=Híd neve: )\w.*
Now I am tring it within python, but it doesn't give back value (it should be like: Líra utca - Ördög-árok feletti gyalogos híd)
Could you help me, where is the mistake?
class FeatureProcessor(object):
def __init__(self):
self.comp_re = re.compile("(?<=Híd neve: )\w.*")
#pass
def input(self,feature):
text_line = feature.getAttribute('text_line_data')
matches = self.comp_re.findall(text_line)
if matches:
feature.setAttribute('PyTrackExtents', matches[0])
self.pyoutput(feature)