Solved

RegEx for null or empty attributes

  • 16 November 2012
  • 4 replies
  • 689 views

Badge
What RegEx can I use to define null or empty attributes in StringReplacer? Or do I even need to use RegEx? I'm trying to replace null/empty attributes with UNKNOWN. Seems simple enought but it's giving me fits.
icon

Best answer by casey 16 November 2012, 18:34

View original

4 replies

Badge
You can use a Tester and set the the operation to Attribute Is Null followed by AttributeSetter

 

 

-Sean
Badge +2
A Tester->AttributeSetter would work as Sean suggested.

 

 

Be aware that there's an al-in-one NullAttributeReplacer transformer that likewise performs what you are after.

 

Badge
Both suggestions work great! Thank you for the quick responses.

 

Userlevel 4
Badge +13
To answer the original question, an expression of "^$" (without the quotes) should match an empty string. It sounds like the NullAttributeReplacer might be more appropriate here, though. 

Reply