Hi,
I am trying to build by validations / filtering logic using ExtFilter component and filter out bad rows.
I have few situations where RegEx can be easily applied but it doesn't work the way I expect it.
For eg - As listed in the examples, I can use ".*Peter.*" or "^A.*" and these works as expected. These are what we call as Quantifiers in RegEx parlance.
But when I use Character Sets, like "[a-zA-Z0-9]" for checking if the data is alpha-numeric, or "\\w" to check for word characters or a different regex to check for email validity, all of this seems to fail.
I have tried these patterns in Java and it seems to work fine -
Pattern p = Pattern.compile(pattern);
Matcher m = p.matcher(data);
return m.find();
Let me know what I am doing wrong.
Thanks,
Param.
I am trying to build by validations / filtering logic using ExtFilter component and filter out bad rows.
I have few situations where RegEx can be easily applied but it doesn't work the way I expect it.
For eg - As listed in the examples, I can use ".*Peter.*" or "^A.*" and these works as expected. These are what we call as Quantifiers in RegEx parlance.
But when I use Character Sets, like "[a-zA-Z0-9]" for checking if the data is alpha-numeric, or "\\w" to check for word characters or a different regex to check for email validity, all of this seems to fail.
I have tried these patterns in Java and it seems to work fine -
Pattern p = Pattern.compile(pattern);
Matcher m = p.matcher(data);
return m.find();
Let me know what I am doing wrong.
Thanks,
Param.
-
hi,
i've just tried a filter expression like this:
$0.Address~="[a-zA-Z 0-9]*" (please note the space character)
and it worked correctly. Are you sure you used the * quantifier? Can you please post an example of data and your filter expression?
Thanks! -
You got me. I did not put the * at the end.
My bad.
Thanks,
Param.
Please sign in to leave a comment.
Comments 2