Will strstr return the same pointer as the first string if the second string is at the beginning?
<p>So basically, I need to find out if a string begins with <code>[URL]</code> and ends with <code>[/URL]</code>.</p>

<p>Right now I'm doing:</p>

<pre><code>const char *urlStart;
// ...
urlStart = strstr(message, "[URL]");
if (urlStart == NULL) {
    urlStart = strstr(message, "[url]");
}

if (urlStart == NULL) {
    return NULL;
}
</code></pre>

<p>According to <a href="http://www.cplusplus.com/reference/cstring/strstr/" rel="nofollow">cplusplus.com</a>, "a pointer to the first occurrence in str1 of the entire sequence of characters specified in str2".</p>

<p>Does that mean I can just do this?</p>

<pre><code>/*
 * If the pointer to message is the same as urlStart,
 * message begins with urlStart
 */
if (message != urlStart) {
    return NULL;
}

// URL starts 5 characters after [URL]
urlStart += 5;
</code></pre>

<p>Initial testing seems to indicate that this doesn't work.</p>

<p>The complete function is located <a href="https://github.com/NobleUplift/TeamSpeak3WebsitePreview/blob/master/ts3websitepreview/plugin.c#L247" rel="nofollow">here</a>.</p>