Support Questions

Find answers, ask questions, and share your expertise

Remove all new lines in Base64 Encoded String using ReplaceText

avatar
Explorer

Hi,

I am trying to remove all new lines from base64encoded string using replaceText processor.

Properties for replaceText processor is as follows:

Search Value : \\n

Replacement Value:$1

Character Set: UTF-8

Maximum Buffer Size: 10MB

Replacement Strategy: Regex Replace

Evaluation Mode: Line-by-Line

 

But this not working.

 

 

1 ACCEPTED SOLUTION

avatar
Explorer

May be it will be useful for someone.

I used searchValue as "\p{C}" and ReplaceValue as empty String

\p{C}  finds all non-printable characters.

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Biswa 

 

Your "Replacement Value" is set to "$1".

This means that the replacement value is the value associated to the first java regex capture group found in your configured "Search Value". 

The issue is your "Search value" contains no capture groups.

 

Perhaps providing a sample input content and desired output content would help here.

Hope this helps you,

Matt

 

avatar
Explorer

Thanks Matt for you response.

Below is the sample input and desired output

 

Sample Input:
sdfasdjfsjdbfuk3ewqe

qweqiwqwdqw372ie=

Desired output

sdfasdjfsjdbfuk3ewqeqweqiwqwdqw372ie=

avatar
Explorer

@MattWho It is not newline, its CTRL M (^M) characters. I am able to see the ^M characters in vi editor.

avatar
Explorer

May be it will be useful for someone.

I used searchValue as "\p{C}" and ReplaceValue as empty String

\p{C}  finds all non-printable characters.