Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: brenosilva on January 11, 2017, 03:57:06 PM

Title: Remove Carriage Return
Post by: brenosilva on January 11, 2017, 03:57:06 PM
Hi guys,

I'm using the follow Screening Rule [b]RegExFind("(?s)(?<=<Data1>)(.*)(?=</Data1>)", "v_data1")[/b] to capture na information that was between <Data1> and </Data1> tags.

The result of this rule is v_data1 ='Data1; Data2 ; Data3;

Data4;'

There is a carriage return in the text.

I couldn't remove the carriage return using StrReplace[v_data1, Char[10], ''] or StrReplace[v_data1, Char[13], ''].

There is a way to remove these carriage return in Regex or in the IRD?
Title: Re: Remove Carriage Return
Post by: Dorian-Grim on January 11, 2017, 04:49:36 PM
Try both char codes in one string replace.
Title: Re: Remove Carriage Return
Post by: brenosilva on January 11, 2017, 05:24:28 PM
I did a research in Genesys Care and I found this:

[i]"There is no availability to remove line breaks  using StrReplace function"[/i]

I really don't know RegEx very well, there is a way to remove line breaks using RegEx? As I know, Screening Rules don't allow the method replace, just find.

There is another way to remove these line breaks from an attach data?
Title: Re: Remove Carriage Return
Post by: victor on January 17, 2017, 01:55:36 AM
The fastest thing (and stupidest) that comes into my mind is to break the attach data into separate pieces using the character/word/length and then trim them out from each separate key and then assemble again, if need to.

We had something similar a while back; however, we handled it on an app side that was giving us CRLF. We replaced them with <JORGE>

Vic
Title: Re: Remove Carriage Return
Post by: terry on January 17, 2017, 06:25:32 PM
Basically StrReplace replaces any chars (if their code is known) including line breaks.
Did you try something like following sequence:
v_data1 = StrReplace[v_data1, Char[13], '']
v_data1 = StrReplace[v_data1, Char[10], '']

If it doesn't work - may be first checks which exactly codes presents line break - codes= Bytes[v_data1, 10].