Answered by:
Matching ID's by Regex

Question
-
Hello everyone,
I want to check ID's using Regex
Shared ReadOnly UniverseChrs As String = "IUMGAPCgTLcia" Shared ReadOnly Steam2Regex As Regex = New Regex("STEAM_(?<Universe>[0-4]):(?<AuthServer>[0-1]):(?<ID>[1-9][0-9]{0,9}$|^2147483647)", RegexOptions.Compiled Or RegexOptions.IgnoreCase) Shared ReadOnly Steam3Regex As Regex = New Regex("(?<Type>[" & UniverseChrs & "]):(?<Universe>[0-4]):(?<ID>[1-9][0-9]{0,9}$|^2147483647)(:(?<Instance>[1-9][0-9]{0,9}$|^2147483647))?", RegexOptions.Compiled)
the ID's formats are
'[U:1:4533645:093919] '[U:1:17309919] 'U:1:254093919 'U:1:354093:914739 'STEAM_0:1:227046959 'STEAM_1:0:358204935
Steam2Regex seems to work, but Steam3Regex not.
Anyone can help me with this?
Thanks in advance.
Answers
-
I think that
(?<Type>[IUMGAPCgTLcia]):(?<Universe>[0-4]):(?<ID>[1-9][0-9]{0,9})(?::(?<Instance>[0-9]{1,10}))?
matches all of U:1:254093919, U:1:354093:914739, [U:1:4533645:093919] and [U:1:17309919].
- Marked as answer by Lersubem Sunday, May 26, 2019 6:08 AM
All replies
-
-
-
I think that
(?<Type>[IUMGAPCgTLcia]):(?<Universe>[0-4]):(?<ID>[1-9][0-9]{0,9})(?::(?<Instance>[0-9]{1,10}))?
matches all of U:1:254093919, U:1:354093:914739, [U:1:4533645:093919] and [U:1:17309919].
- Marked as answer by Lersubem Sunday, May 26, 2019 6:08 AM
-