Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I’m new to talend and trying to use the profiler tool to analyse data in a csv file. Values in one of the columns in the file has to be exactly 50 characters long (any characters allowed, even spaces should be included).
I’ve tried regex patterns ^.{50}$ and ^[\S\s]{50}$ but I don’t get matches when a value in the column begins and/or ends with spaces (total characters including the spaces are 50 when I’m testing - but no match). Anyone who has an idea why?
Hello,
If we understand your requirement very well, maybe you could try ^[a-zA-Z,]{1,50}$
We will appreciate it if you could post your input data sample content here.
Elaborating your case with an example with input and expected output values will be preferred.
Best regards
Sabrina
Hi Sabrina, thanks for your response
So I want to make sure the value in the column is EXACTLY 50 characters. That is the goal with this expression. I believe your regex matches only letters a-z, A-Z with minimum 1 and max 50.
I want it to match for example:
' gggdhfjgkdlj jhdgsyru odk837<o +d-sgayr29l sjflm ' (50 characters with space in the beginning and end)
' aa' (50 characters with 48 spaces in the beginning)
'aa ' (50 characters with 48 spaces in the end)
I don't want to match values in a column that contains more than 50 characters. Does that make sense?
However, using the regex in my original post, in Talend, only matches values that start AND end with a character that is NOT a space. E.g.
'pfagdhfjgkdlj jhdgsyru odk837<o +d-sgayr29l sjflmo' (50 characters with a non-space character in the beginning and end)
'a aa' (50 characters with a non-space character in the beginning and end)
'aa a' (50 characters with a non-space character in the beginning and end)
Appreciate your help!