/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, [your code here]

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Apr 6 15:05:13 UTC 2018


On Fri, Apr 06, 2018 at 01:10:07PM +0000, jason via Digitalmars-d wrote:
> what is this?

It's a poor man's URL matcher.

(Yeah, hard to believe, but most of the unreadability is caused by the
Leaning Toothpick Syndrome caused by the poor choice of using / as regex
delimiter when literal '/'s occur so frequently in the pattern.)


T

-- 
A program should be written to model the concepts of the task it performs rather than the physical world or a process because this maximizes the potential for it to be applied to tasks that are conceptually similar and, more important, to tasks that have not yet been conceived. -- Michael B. Allen


More information about the Digitalmars-d mailing list