Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I am using a tMap to read in some data, transform it and output a new file.
I would like to use a regular expression to parse the string in one of the columns.
As an example, here is a raw input string:
Firstname Surname:Acme - 364315
I would like to be able to apply a regex to the above string to return only Firstname Surname
My syntax is totally wrong, but I am looking for something along the lines of row1.columname.parse("[^:]*") to go into the expression for that particular column
I understand there is a simple way to do this using the normal Java string manipulators to find the first instance of ":" and then get everything up to there. But I want to be able to use regex because I have more complex constructs that I want to be able to use regex with. Ie being able to use RegEx is important. Don't get hung up on the simplicity of my example above
What is the syntax I should be using please?
Thanks
Thanks, that worked. My regex wasn't working before. But your solution does the trick. Cheers!