What\'s the regular expression to check if a string starts with \"mailto\" or \"ftp\" or \"joe\" or...
Now I am using C# and code like this in a big if with many ors
The following will match on any string that starts with mailto, ftp or http:
mailto
ftp
http
RegEx reg = new RegEx("^(mailto|ftp|http)");
To break it down:
^
(mailto|ftp|http)
|
I would find StartsWith to be more readable in this case.
StartsWith