Need some guidance on below scenario
Suppose I have a text value like → axftrbc.10111.111.0101
I want the output to be only → axftrbc
I also want to check if the original text contains a .(dot) or something like the format or anything to ensure when i split it do not break, then i want to split it and get this first server value → axftrbc.
Looking for some solutions.
How about the following?
Thanks for this.
Will this also work if the text axftrbc.10111.111.0101 changes to this → axftrbc.10111.111.0101.111.1234.12345 meaning increasing in values post .(dot)?
Do you mean you also want to extract “axftrbc” from “axftrbc.10111.111.0101.111.1234.12345”? If so, the above expression also works for it.
Ok thanks I will test and let you know the results
I am getting some error when I am using this.
In my use case I want to use it in a invoke code activity, something like below(example)
If row("Host name").ToString.equals("abcdef.1101101.191.10") Then
row("Host name")=row("Host name").Replace("abcdef.1101101.191.10","abcdef")
Here If Host name column contains the above regex matching value ->abcfdr.11011.1101.11 this one then i want to replace it with that first value → abcfdr
I tried your code by incorporating in invoke code but it is giving compilation error.
Can you please help here.
Can you share screenshot with error message?
I think I am doing wrong.
I’m not sure it’s fit your requirement, but can you try to use the following condition in If statement in line 2? Probably warning will be disappeared.
try this one
If you are trying to get the first value before to the dot in the string, its better to use the Split method.
This will give you the first value.ie, axftrbc
Hello @Dhruvi_Arumugam Please modify the if condition expression like below
If System.Text.RegularExpressions.Regex.IsMatch(row("Host name").ToString,"^.*(?=\.)")
Now, see if that issue still appears