Skip to main content

Hello,

I'm using attributevalidator to make multiple check on attributes.

There is one check I don't know how to implement. I would like to hightlight the attributes finishing with newline. I used this regex : [^(\\n)]$ . It is working when I use external tools (for example (https://regexr.com/ ), but not in FME. I didn't find any other regex to do that (I'm a beginner in regex).

In case, there is one other solution : using tester/attributecreator, but if possible, I would like to gather all the tests in the same transformer to make the workflow as simple as possible (the workflow contains a lot of attribute / spatial tests)

 

Thank you

 

 

If you want to find anything where the last character is a newline try

.*\n$

Edit: or are you looking for a statement so that anything ending in a newline comes out the failed port?


Thank you, but I would like anything ending with a newline comes out the failed port. Then the workbench would provide automatically a report listing the objects that doesn't respect the rules described in the attributevalidator transformer.


Try, if you just want to fail strings ending in a newline

<^\n]\z

Thanks a lot :-). The following regex you provide me works perfectly !

>^\n]\z

Thanks a lot :-). The following regex you provide me works perfectly !

>^\n]\z

Matching end of lines and new lines differs depending on the underlying regex flavour, which is why you were getting differing results with external tools. The above for example, wouldn't work if you were trying to use the regex in python. 


Reply