Can anyone Help with RegEx Expression?

Can anyone give me a RegEx expression that selects the text between the tags?

mQENBGTWYeQBCADdzfFUWqBRQi3843KHKs78WScKyDXR8jPzuJ28HaadIETDgS/D
pWo7t4AOI6ZUx40A8htXOkcIMI1ZygCPmSvCRsK/8ZvNIpGvmZz9x1xMoo66rS1R
GTDkr0RqjWxaHUDV02jgnDq2ipM/uYj/xbqcUKpfdIXzJ9PLhyVBE9RpZCyF4E6w
nIx3GntUwyMYQBPX7MP+Lo+ktww7X3LDKL7sU6rZV9pdCuUTtrlleGp6QfU6L3Bx
J4DP9lUTO/5qhceVKX9tIz+O5N44HzXW5X18aQWDjQ0q+Mr+4mo1gZflMZrFVxoj
S+07owi6ccHyoitgPHFar6HtHln+EQOwNzM3ABEBAAG0L1ZhbGVudGUsIFNvZmlh
ICg5MjMpIDxzb2Z2YWxlQGVtZWEuY29ycGRpci5uZXQ+iQFXBBMBCABBFiEE0iux
nBy1bypQFZQ8RtjZDOdAYxcFAmTWYeQCGwMFCQWknswFCwkIBwICIgIGFQoJCAsC
BBYCAwECHgcCF4AACgkQRtjZDOdAYxffiwf/aQz+vn+EmNYCsCoTqCP03bzCXY9f
GHPCKj6XNFMym8yBpoK7CBFKNZO8AOqzYZrETmAlOoWXM0lC9QkyyW9K9Y56WxTL
qn+nOwwXQV4pC/ablzG0GtY6nFwBQ5lemPPzENZi7ag2sTehcR2RKFzigWi9zgN3
ZsxizKIbpw4A90Gp2M9YEZ4seDJI5jcy2fwx0OZyyXScFbt4p6ae9NQm3e9HCI8G
jPFnuxu0lJHHgYLYVr4cBw3UHyMr7bzvMtHSCRFGOMvk254WMapdVuU0ZA3W4tom
AdwOkYmj689PUmEkjOAJt0h6l7N7MGAG0/jERB55yL7aG3zmNak6fZykXQ==
=7aZ1

Hi @rodrigo.simao

Can you specify what is the output you need in bold so that we can help you with regex.

Regards,

The desired output is the text that is displayed in the post, I don’t know why but it doesn’t let me put the tags. There is one in the beginning and one at the end.

it’s like this and I want the text between the tags.

image

@rodrigo.simao
For sharing code snippets please use the </> Format button from editor

sounds like XML extraction

1 Like

@rodrigo.simao

can you try this

system.text.regularexpression.regex.match(yourtext,“(?<=).*?(?=)”).value

cheers

Already did and it does not work :confused:

@rodrigo.simao

inputstr=inputstr.Split({“”“},StringSplitOptions.RemoveEmptyEntries).Last.ToString.Split({”"},StringSplitOptions.RemoveEmptyEntries).First

Try this

cheers

keep in mind:
grafik
grafik

so we do:
grafik

But for XML we still recommend XML related techniques.When XML is defining namespaces we do handle as:
XML Extraction - Handling Namespaces (Tableau, Soap, OASIS types) - Help / Community - UiPath Community Forum

@rodrigo.simao

(?<=\>)[\s\S]*?(?=\<)

Try the above expression

Hope it helps!!

You can try this way also it may help to you

str_Variable =System.text.RegularExpressions.Regex.Replace(strText,“|<[Tag2>”,“”).Trim

@rodrigo.simao

Hello!

image

looks like it’s missing just a few characters, but so far it’s the best one I found

I need it to be dynamic, I want if it is needed to change it without having to touch my code, just the config file

@rodrigo.simao

“(?<=<\w+>).*?(?=</\w+>)”

check this

Doesn’t work my friend, but thank you anyways.

@rodrigo.simao

can you send me that text?

Regards

@rodrigo.simao
can you try once again

cheers

mQENBGTWYeQBCADdzfFUWqBRQi3843KHKs78WScKyDXR8jPzuJ28HaadIETDgS/D
pWo7t4AOI6ZUx40A8htXOkcIMI1ZygCPmSvCRsK/8ZvNIpGvmZz9x1xMoo66rS1R
GTDkr0RqjWxaHUDV02jgnDq2ipM/uYj/xbqcUKpfdIXzJ9PLhyVBE9RpZCyF4E6w
nIx3GntUwyMYQBPX7MP+Lo+ktww7X3LDKL7sU6rZV9pdCuUTtrlleGp6QfU6L3Bx
J4DP9lUTO/5qhceVKX9tIz+O5N44HzXW5X18aQWDjQ0q+Mr+4mo1gZflMZrFVxoj
S+07owi6ccHyoitgPHFar6HtHln+EQOwNzM3ABEBAAG0L1ZhbGVudGUsIFNvZmlh
ICg5MjMpIDxzb2Z2YWxlQGVtZWEuY29ycGRpci5uZXQ+iQFXBBMBCABBFiEE0iux
nBy1bypQFZQ8RtjZDOdAYxcFAmTWYeQCGwMFCQWknswFCwkIBwICIgIGFQoJCAsC
BBYCAwECHgcCF4AACgkQRtjZDOdAYxffiwf/aQz+vn+EmNYCsCoTqCP03bzCXY9f
GHPCKj6XNFMym8yBpoK7CBFKNZO8AOqzYZrETmAlOoWXM0lC9QkyyW9K9Y56WxTL
qn+nOwwXQV4pC/ablzG0GtY6nFwBQ5lemPPzENZi7ag2sTehcR2RKFzigWi9zgN3
ZsxizKIbpw4A90Gp2M9YEZ4seDJI5jcy2fwx0OZyyXScFbt4p6ae9NQm3e9HCI8G
jPFnuxu0lJHHgYLYVr4cBw3UHyMr7bzvMtHSCRFGOMvk254WMapdVuU0ZA3W4tom
AdwOkYmj689PUmEkjOAJt0h6l7N7MGAG0/jERB55yL7aG3zmNak6fZykXQ==
=7aZ1

There you go my friend

Tried and still nothing :confused:

@rodrigo.simao

Please try the given regex in regexr or else in UiPath Studio. If using ins UiPath studio then remove the ignore case check box and give a try.

(?<=\>)[\s\S]*?(?=\<)

It works!!

Hope it helps!!