Skip to main content
Question

Expand regex editor to AttributeTrimmer

  • June 23, 2025
  • 7 replies
  • 69 views

p_c_20
Supporter
Forum|alt.badge.img+9

Would be great if Regex Editor and AI assist was added into AttributeTrimmer rather than having to use the Regex functions in text editor, which are clunkier. In fact, it could go in any and all string transformers where you are trying to identify, use or replace a substring. 

7 replies

alexbiz
Influencer
Forum|alt.badge.img+28
  • Influencer
  • June 23, 2025

AttributeTrimmer only remove leading and trailing characters of an attribute.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Transformers/attributetrimmer.htm

It would be weird to use regex here.

 

You might want to use the StringReplacer instead, which can use regex and replace with no character.


p_c_20
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • June 23, 2025

AttributeTrimmer only remove leading and trailing characters of an attribute.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Transformers/attributetrimmer.htm

It would be weird to use regex here.

 

You might want to use the StringReplacer instead, which can use regex and replace with no character.

How about if I want to left trim [^\w] down to nothing?


alexbiz
Influencer
Forum|alt.badge.img+28
  • Influencer
  • June 23, 2025

 


p_c_20
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • June 23, 2025

 

Yes, but left/right trim, not replacing in the middle of a string (which is what this would do, right?)


alexbiz
Influencer
Forum|alt.badge.img+28
  • Influencer
  • June 23, 2025

^ mean the start of the string

$ mean the end of the string

 

^\w* litteraly translate to “all word characters (from 0 to x) at the beginning of the string”


alexbiz
Influencer
Forum|alt.badge.img+28
  • Influencer
  • June 23, 2025

So this is a left trim, it will not replace value in the middle of your value


p_c_20
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • June 23, 2025

So this is a left trim, it will not replace value in the middle of your value

Ah. Many thanks