Regular expression – What is the best way to verify the URL input by the user in the Cocoa application?

I am trying to build a self-made web browser in order to become more proficient in Cocoa. I need a good way to verify whether the user has entered a valid URL. I have tried some regular Expressions, but NSString has some interesting quirks, and I don’t like most of the back references of regular expressions I have seen.
You can start from the + (id)URLWithString:(NSString *)URLString method of NSURL, if the string format is wrong, it will return nil.

< /p>

If you need further verification, you can use baseURL, host, parameterString, path and other methods to provide you with specific components of the URL, and then you can evaluate it in any way you see fit.

I am trying to build a homemade web browser to become more proficient in Cocoa. I need a good way to verify that the user has entered a valid URL. I have tried some regular expressions , But NSString has some interesting quirks, and doesn’t like most of the regex back references I have seen.

You can download from NSURL The + (id)URLWithString:(NSString *)URLString method starts, if the string format is wrong, it returns nil.

If you need further verification, you can use Methods such as baseURL, host, parameterString, path provide you with specific components of the URL, and then you can evaluate it in any way you see fit.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5430 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.