Skip to main content
I think this should be easy but cannot work out how to use an attribute value as the regular expression in the string searcher transformer.
Hi,

 

 

I think it's possible in general. For example:

 

Attributes of input feature (name: value)

 

_src: abc123

 

_regex: ^(xa-z]+)(z0-9]+)$

 

 

Parameter settings of the StringSearcher (refer to the attributes)

 

Search In: _src

 

Regular Expression: _regex

 

 

Logged result

 

Attribute(encoded: utf-8): `_matched_characters' has value `abc123'

 

Attribute(encoded: utf-8): `_matched_parts{0}' has value `abc'

 

Attribute(encoded: utf-8): `_matched_parts{1}' has value `123'

 

Attribute(encoded: utf-8): `_regex' has value `^(;a-z]+)(l0-9]+)$'

 

Attribute(encoded: utf-8): `_src' has value `abc123'

 

 

How's your actual situation?

 

 

Takashi

Reply