I'm attempting to build a function that will return a regex that is dynamically created. The regex to create will be a range check between two numbers. So far I've got something similar to this (not finished as yet).
Is this approach valid, or is there an easier way that I'm overlooking?
Public Shared Function Range(ByVal Minimum As Integer, ByVal Maximum As Integer) As String
Return "^([" & Minimum.ToString.PadLeft(2, "0") & "]" & Microsoft.VisualBasic.StrDup(Minimum.ToString.Length, "[0-9]") & "|2[0-4][0-9]|25[0-5])$"
End Function