+ (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.
div>
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