vindarel / cl-str

Modern, simple and consistent Common Lisp string manipulation library.
https://vindarel.github.io/cl-str/
MIT License
309 stars 37 forks source link

request: domain-name-p/domain-name? #40

Closed compufox closed 4 years ago

compufox commented 4 years ago

thought some kind of predicate to see if a string contains a domain-name or a url would be nice!

vindarel commented 4 years ago

mmh this seems to bypass cl-str's domain. Don't you want a url-handling library like quri? see parse-uri: https://github.com/fukamachi/quri#function-parse-uri

compufox commented 4 years ago

thats understandable!

to clarify: my request isnt so much parsing or manipulating a domain name, but just running a regex to determine if a string contains a domain name. ive found that quri, if not given a full proper uri, will return bad data, hence me requesting here!

thanks for looking at this :)

alphapapa commented 4 years ago

How would you determine whether a string contains a domain name without either having a database of domains or making a network request? Here's a string that contains a domain name: What is the point? I assume this.is it. Here's a string that does not: thi.sis.

compufox commented 4 years ago

thats a good point! Yeah I guess I was only thinking of a specific use case.