Skip to main content

Hello everyone

I try to extracted from a character string the end of a block separated by a /


for example



_temp / resources / temp / 2017072_email / 12-680-RER



@FindRegEx (@Value (_temp), /, - 1 ,,)



I can not find the right syntax to look for the character / starting from the right

And then cut the block with a @right at the position of the /


thank you for your comeback

Hi @cprhamel,

In your case i used the transformer AttributeSplitter to split in " / ". After a list attribute is created:

You can get the last list attribute: _list{4}.

Thanks


Hi @cprhamel,

In your case i used the transformer AttributeSplitter to split in " / ". After a list attribute is created:

You can get the last list attribute: _list{4}.

Thanks

Continue with transformer ListElementCounter to get the number of lists created.

 

 

With ExpessionEvaluator @value(_element_count) - 1 ) get dynamic mode the last List number.

 

 

The AttributeManager it mapped the the value to new Attribute Last_element = @Value(_list{@Value(_result)}).

 

 

Attached the template file.

 

 

Thanks,

 

Danilo - workspace-list.fmwt

 

 

 


Try with regex [^\\/]*$ so @FindRegEx(@Value(filename),[^\\/]*$)

 

Using the regex in a stringsearcher is an easier way to return the value than using findregex and then cutting the string though


If your goal is to extract the last part (i.e. "12-680-RER") from the slash separated string, you can use the @ReplaceRegEx with this setting.

@ReplaceRegEx(@Value(_temp),.+/\s*(.+?)$,\1)

Thank you for your answers

They work well

 

I will use that egomm to stay in my usual schema

Can you explain to me the set of code used
For later use

Thank you all for your cooperation

Reply