Skip to main content
Question

Replace string value NOT matching regex, else <null>


townest
Contributor
Forum|alt.badge.img+4

Hello,

In one field, I want to keep all string values matching the regex:

\\d{4}-\\d{2}-\\d{2}

and relegate all strings NOT matching that string to:

<null>

 

See following image for my attempt where I developed ^(?!\\d{4}-\\d{2}-\\d{2}).* as the negation of \\d{4}-\\d{2}-\\d{2} and set replacement to <null>. This did not work.

foot_surv_fmeAny pointers would be greatly appreciated!

Tyler

2 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • July 12, 2022

You could do something like this, test if you get a match on the regexpression (this returns 0) then set the value to null if no match is found

 

image


townest
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • July 13, 2022
ebygomm wrote:

You could do something like this, test if you get a match on the regexpression (this returns 0) then set the value to null if no match is found

 

image

Thanks @ebygomm​ , that got me on the right track. I ended up using your concept, modified a bit, and in an attribute manager so I could take care of other attributes simultaneously. Here's the result.

imageTyler


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings