Skip to main content
Solved

RegEx for null or empty attributes

  • November 15, 2012
  • 4 replies
  • 3180 views

Forum|alt.badge.img
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.

Best answer by casey

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

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

Forum|alt.badge.img
  • November 15, 2012
You can use a Tester and set the the operation to Attribute Is Null followed by AttributeSetter

 

 

-Sean

Forum|alt.badge.img+4
  • November 16, 2012
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.

 


Forum|alt.badge.img
  • Author
  • Best Answer
  • November 16, 2012
Both suggestions work great! Thank you for the quick responses.

 


fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • November 18, 2012
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.