Removing a page from text

How do I remove a strip and return it to the same position?

0
source share
5 answers

Use regular expressions .. you can easily find the url with regular expressions.

URL discovery

Template Replacement

+6
source

There are several ways to regex a rfc3986 compatible URL

For string C, the regex will look like this:

"^(([^:/?#]+):)?(//([^/?#]*)|///)?([^?#]*)(\\?[^#]*)?(#.*)?"
enum {
    URL = 0,
    SCHEME_CLN = 1,
    SCHEME  = 2,
    DSLASH_AUTH = 3,
    AUTHORITY = 4,
    PATH    = 5,
    QUERY   = 6,
    FRAGMENT = 7
};

If the listing indicates which capture indexes correspond to those parts of the URL.

+1
source

URL- , / . .

0

, , [ preg_replace_callback] (http://www.php.net./preg_replace_callback).

, , , .

0

, :

http://www.codinghorror.com/blog/archives/001181.html

, , , , , - http://www.codinghorror.com/blog/archives/001181.html-- .

I do not often use PHP, but the problem boils down to trying to figure out the template that will be used in the preg_replace call.

0
source

Source: https://habr.com/ru/post/1707949/


All Articles