*ABH445677-BH
These special characters will varu
Need to remove special character at front
And remove special character at end along with the preceeding characters
Output:
ABH445677
*ABH445677-BH
These special characters will varu
Need to remove special character at front
And remove special character at end along with the preceeding characters
Output:
ABH445677
Hi @Demo_User
You can use the following RegEx for the same:
\b([A-Za-z0-9]+)-[A-Za-z0-9]+\b
Hope this helps,
Best Regards.
Returning blank value
Well, in that case, you can use this pattern:
\b([A-Za-z0-9]+)
UiPath syntax will be like this:
outputData = System.Text.RegularExpressions.Regex.Match("ABH445677-BH","\b([A-Za-z0-9]+)").Groups(0).ToString
Hope this helps,
Best Regards.
I hope this should work - Such a brilliant one.
Another way
System.Text.RegularExpressions.Regex.Match(str,"\w+").Value
- this will get only first matched so would get the exact string
Cheers