I tried to test a string like “http://test.nl” for (http://|https://)...

It would be nice to use an escaped slash in a regular expression like /(http://|https://).../.match(“http://test.nl”)
but that leads to java.util.regex.Pattern.compile(“(http:\/\/|https:\/\/).\..”).matcher(blabla)



My regular expression now is /(http:[/]{2}|https:[/]{2}).../ which works fine but is less natural for a regular expression

Submitted on 14 June 2010 at 12:36

Log in to post comments