Hi Everyone,
In the above string, i want the string of 8 digits highlighted without any hyphen. Could you please help me on this?
Thanks,
Ulaga
Hi Everyone,
In the above string, i want the string of 8 digits highlighted without any hyphen. Could you please help me on this?
Thanks,
Ulaga
Is there always an F in front of it? In that case: F\d{7}
Here \d means any digit, and {7} means ârepeat 7 timesâ. So this will match any part of the string where thereâs a capital F followed by 7 digits.
Thank you. Any alphabet will be in the beginning and the hyphen also could be anywhere in the string
JIFLOPIO (I want to retrieve only this string without any hyphen)
-IFOPFLW
Hello @Boopathi
Try this
Dim match As Match = Regex.Match(input, âCN=.*([a-zA-Z1-9]{8}),â, RegexOptions.IgnoreCase)
@Boopathi Have a look at below regex link it matches alphabets followed by seven digits
@Boopathi please be clearer as to what you want exactly. I see that your output could be an alphabet followed by 8 (BTW I see only 6) digits with a possibility of a hyphen anywhere in between the characters. But do be clear about what your desired output is. Do you just want the digits form such strings? Or do you want to extract any such strings where the above conditions hold true?
Say your input is this: F9078-74.
What is your desired output?
This pattern should match any occurence of 8 characters without hyphen anywhere in the string.
(?<!-)\w{8}(?!-)
Iâm not sure, but I think this is exactly what youâre looking for:
â[a-zA-Z][\d-]{7}â
Use the above regex string in the âmatchesâ activity of UiPath. The result will give you strings with 8 characters that start with an alphabet, has digits and the hyphen could be anywhere. Now if you donât want these matches to have hyphens, just replace the hyphen (-) in the matched strings with an empty string (ââ).
Hey @Boopathi
Will you clarify ? 8 digits? excluding Alphabet ?
and 8 digits count with Hyphen count or without ?
RegardsâŚ!!
Aksh
Thank you everyone. To be clear I want 8 characters without the character [-]
Thanks,
Ulaga
@evangemert. Thank you. It works as expected.
Apparently, he wasnât looking for this. He meant he needed only those strings with eight characters which do NOT have a hyphen in it.
@siddharth
Well what i asked before it was related with that and even if she wants want u then it is a simple change -
@Boopathi
[\w]{8}$
RegardsâŚ!!
Aksh
Hi @aksh1yadav and @siddharth. Thank you for your suggestions and got the solution.
@dkollyns Thank you. It works as expected