Regular expressions with \K

Hi,
Regex patter “Surname\s+\K.*(?=Contact)” that i use within Match activity fails due to this error "Unrecognized escape sequence \K "

Full text of encointered error:
“message”: “Matches: parsing "Surname\s+\K.*(?=Contact)" - Unrecognized escape sequence \K.”,

can i have the full string if possible
kindly place that \K between bracktets like this (\K)

or it would be great like if we have the full string and which part is required from it

Cheers @kuzinyd

@Palaniyappan error reproduces

I believe \K is not supported by latest .Net framework. You can use the alternate for that @kuzinyd

Hi @HareeshMR could you elaborate on that?

I mean, if you have any alternate for that (instead of \k) use that.

Can you post the text you have and the requirement, so that we can try and get back to you

@kuzinyd

Pass slash two times “\\K” so it will resolve.

@HareeshMR here you can find a test string

After reading word file , data is being stored in a string. For testing purproses I output it via Log Mesage and see that it tranforms all the spaces, new lines etc to symbols like \r \u 00007 and so on…
Then i search for name in that string by using regular expression, and it would seem that “Vicky\r\u0007\r\u0007\r\u0007\r\u0007” will be returned. but when i iterate over matches there’s nothing to print

@kuzinyd Can you specify what output you need from that string.

Certainly,it’s Vicky

@kuzinyd Every time after name \r\u0007\ whether \ will be present or not

@indra there may be no such characters at all, thank you

Actually, there is no new line character in the string you provided in the regex @kuzinyd. There are spaces in the string, so you need to check the spaces to get the value

image

@HareeshMR this is what \s+ there for