Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
996 views
in Technique[技术] by (71.8m points)

parsing - A Delphi/FreePascal lib or function that emulates the PHP's function parse_url

I'm doing a sitemap producer in Object Pascal and need a good function or lib to emulate the parse_url function on PHP.

Does anyone know of any good ones?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I am not familiar with the parse_url function on PHP, but you might try the TIdURI class that is included with Indy (which in turn is included with most recent Delphi releases). I think they ported it to FreePascal as well.

TIdURI is a TObject descendant that encapsulates a Universal Resource Identifier, as described in the Internet Standards document:

RFC 1630 - Universal Resource Identifiers in WWW

TIdURI provides methods and properties for assembly and disassembly of URIs using the component parts that make up the URI, including: Protocol, Host, Port, Path, Document, and Bookmark.

If that does not work, please give a specific example of what you are trying to accomplish - what are you trying to parse out of a URL.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...