Hi All,
I need regex to find Football in the string below:
Game Request | Member : Football
I need Football from the above string.
Thanks!
Anmol
Hi All,
I need regex to find Football in the string below:
Game Request | Member : Football
I need Football from the above string.
Thanks!
Anmol
Hello,
This pattern should work:
(?<= \ : )(.*)
*Please delete the space character between backslash and β:β character
Hi @anmolk171
You can try one more thing, you can use split string method like this
yourArray = yourString.Split(":",c)
Now the item at index 1 in the array would be the name of the game
Thanks,
Prankur
(?<= \ : ) - Is a positive lookbehind, it searches for the ": ", colon needs to be preceded by the backslash, because itβs special character.
(.*) - Is matching everything after previous pattern.
Please try the online regex testers to understand regex more.
Regards
That is a great solution, you can try this also
yourString.Substring(yourSTring.LastIndexOf(":")+1).ToString
Thanks,
Prankur
Thanks @PrankurJoshi, @olgu
Both the solutions are working for me. I want to do it with regex just for learning.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.