首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

一种精确从文本中提取URL的思路及实现

在今年三四月份,我接受了一个需求:从文本中提取URL。这样的需求,可能算是非常小众的需求了。大概只有QQ、飞信、阿里旺旺等之类的即时通讯软件存在这样的需求。在研究这个之前,我测试了这些软件这块功能,发现它们这块的功能还是非常弱的。这类软件往往也是恶意URL传播的媒介,如果不能准确识别出URL,相应的URL安全检测也无从谈起。而且网上也有很多使用正则表达式的方法,可是我看了下,方法简单但是不够精确,对于要求不高的情况可以胜任,但是如果“坏人”想绕过这种提取也是很方便的。(转载请指明出处)下面也是我在公司内部做的一次分享的内容:

02

线上Nginx镜像构建及容器使用

MAINTAINER nan RUN yum -y install gcc gcc-c++ make \ openssl-devel pcre-devel gd-devel \ libxml2-devel libxslt-devel zlib-devel \ gd-devel perl-ExtUtils-Embed \ iproute net-tools telnet wget curl && \ yum clean all && \ useradd -s /sbin/nologin -M nginx && \ mkdir -p /var/tmp/nginx && \ rm -rf /var/cache/yum/ RUN wget http://nginx.org/download/nginx-1.15.9.tar.gz &&\ tar -zxvf nginx-1.15.9.tar.gz && \ cd nginx-1.15.9 && \ ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx \ --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid \ --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module \ --with-threads --with-file-aio --with-http_v2_module \ --with-http_realip_module --with-http_addition_module \ --with-http_xslt_module --with-http_image_filter_module \ --with-http_sub_module --with-http_flv_module \ --with-http_mp4_module --with-http_gunzip_module \ --with-http_gzip_static_module --with-http_auth_request_module \ --with-http_secure_link_module --with-http_slice_module \ --with-http_perl_module --with-compat \ --with-stream --with-stream_ssl_module --with-stream_realip_module \ --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client \ --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi \ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre && \ make -j 4 && make install && \ cd / && rm -rf nginx-1.15.9 && \ ls -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

01

扫码

添加站长 进交流群

领取专属 10元无门槛券

手把手带您无忧上云

扫码加入开发者社群

相关资讯

热门标签

活动推荐

    运营活动

    活动名称
    广告关闭
    领券