【问题标题】:Whats the name of the codes (//-\\.*)代码的名称是什么 (//-\\.*)
【发布时间】:2017-02-21 09:35:00
【问题描述】:

请给出谷歌搜索的关键字..教程

PHP 文件的第一行

    public function get_supported_url_patterns()
{
    return array('/https?:\\/\\/(www\\.)?example\\.com\\/movies\\/[0-9]+\\/[^\\.]+\\.html.*/i');
}

第二个代码

    protected function get_content_page_url_finder_pattern()
{
    return '|<a[^>]*href\\ *?=[\\ \'"]*?(https?:\\/\\/(www\\.)?example\\.com\\/movies\\/[0-9]+\\/[^\\.]+\\.html)[\\ \'">]?|i';
}

1 个例子:

    protected function get_pagination_url_finder_selectors()
{
    return array('.pager a');
}

2 个例子:

if (preg_match('/240p[\'"]\\ *:\\ *[\'"]([^\'"]*cdn[^\'"]*\\.com[^\'"]*)[\'"]/i', $page_code, $temp)) {
            }
        }
        else {
        }

        str_replace('/', trim('\\/', '/', trim($temp[1])));

        if (preg_match('/480p[\'"]\\ *:\\ *[\'"]([^\'"]*cdn[^\'"]*\\.com[^\'"]*)[\'"]/i', $page_code, $temp)) {
            $result->add_video_file('480p', str_replace('\\/', '/', trim($temp[1])));

            if (preg_match('/720p[\'"]\\ *:\\ *[\'"]([^\'"]*cdn[^\'"]*\\.com[^\'"]*)[\'"]/i', $page_code, $temp)) {
            }
        }

感谢您的帮助

【问题讨论】:

  • 正则表达式或模式
  • 谢谢...罗比·科内利森

标签: php url url-rewriting url-routing


【解决方案1】:

那些是 preg 模式。 Perl 兼容的正则表达式。

【讨论】:

    猜你喜欢
    • 2023-04-10
    • 2019-10-30
    • 1970-01-01
    • 2017-01-18
    • 2015-03-09
    • 2019-09-10
    • 2013-04-06
    • 2013-12-11
    • 1970-01-01
    相关资源
    最近更新 更多