I've been working on trying to get this string split in a couple different places which I managed to get to work, except if the name had a forward-slash in it, it would throw all of the groups off completely.
The string:
123.45.678.90:00000/98765432109876541/[CLAN]PlayerName joined [windows/12345678901234567]
I essentially need the following:
- IP group: 123.45.678.90:00000 (without the following /)
- id group: 98765432109876541
- name group: [CLAN]PlayerName
- id1 group: 12345678901234567
The text "joined" also has to be there. However windows does not.
Here is what I have so far:
(?<ip>.*)\/(?<id>.*)\/(.*\/)?(?<name1>.*)( joined.*)\[(.*\/)?(?<id1>.*)\]
This works like a charm unless the player name contains a "/". How would I go about escaping that?
Any help with this would be much appreciated!
/in player names. Or, translate a/in player name to something like%SLASH%and then display it as a/accordingly.@"^(?<ip>[\d.:]*)/(?<id>\d+)/(?<name1>\S+) joined \[\w+/(?<id1>\d+)]$"pattern. See demo.