If a string has no digits in it, I would like to replace it with "Invalid" using Java (shorthand); this is to be an expression in the tMap component in Talend Open Studio
Here are some examples of desired outcomes:
Here are valid entries that should stay the same and remain unchanged, they are valid:
"1234"
"123-456-7890"
"(123) 456-7890"
Here are some values that are to replaced with "Invalid":
"asdf"
"(xxx) xxx-xxxx"
"() -() -()"
"***-***-****"
"- -"
Here's what I've tried so far:
myTable.myField.replaceAll("[0-9]","").isEmpty() ? "Invalid" : myTable.myField
But it's not working out, at least not in Talend