uandi_ks
(Kstukemeier)
October 13, 2021, 9:20am
1
Hey everyone,
I want to check if in a text is a address like:
test gmbh
testway 123
1234 US
this address is olways the same so i found out that i can check for the phrases like this:
(test gmbh|testway 123|1234 US)
but I want that if one phrase is different like:
test gmbh
testway 123
1234 USA
I don’t get an outcome. And other question is how I can put special sine like + in the regex phrase?
thanks for your help.
ppr
(Peter)
October 13, 2021, 9:26am
2
give try on
and refer to groups:
ppr
(Peter)
October 13, 2021, 9:31am
4
see updated for the adress
war aber nicht sicher ob, klammer und pipe im string wirklich vorkommen oder es symbolisch gemeint war
uandi_ks
(Kstukemeier)
October 13, 2021, 9:32am
5
nop das war der regex denn ich mir so schomn gebaut hatte
ppr
(Peter)
October 13, 2021, 9:39am
6
when we are bound to line breaks keep in mind the windows typically linebreaks \r\n which do handle defensive:
As a starter (when we do have the adress text block isolated)
but maybe can also handled with the string split method
uandi_ks
(Kstukemeier)
October 13, 2021, 9:53am
7
I think you understand me wrong I won’t. I have a string and I want to check in the string if this address exists and the address is all the time the same.
ppr
(Peter)
October 13, 2021, 9:58am
8
Ok, thanks for clearification
maybe a LINQ will also serve:
arrAdressTokens = {"test gmbh","testway 123","1234 US"}
assign activity:
left: check | Boolean
right:
arrAdressTokens.All(Function (x) YourAdressString.Contains(x))
Saksham
(Saksham Rastogi)
October 13, 2021, 10:01am
9
Hi @unandi_ks
If there is no compulsion on using regex,
You can use an InStr(VB) method or Contains method (C#)
Let’s say you have a String variable which contains the input text
String text = “test gmbh
testway 123
1234 US”
You can use the following expression to check if the text that you want to search exists or not
(
Len(text)>0
AND
InStr(text, “test gmbh”)>0
AND
InStr(text, “testway 123”)>0
AND
InStr(text , “1234 US”)>0
)
If the whole expression is true, then you got a match else no match
1 Like
uandi_ks
(Kstukemeier)
October 13, 2021, 3:00pm
11
system
(system)
Closed
October 16, 2021, 3:01pm
12
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.