随便写了下,测试效果初步出来了。只是还有所欠缺,只当抛砖引玉吧([\S|/]+:\s)([\S]+)

解决方案 »

  1.   


    ZT_King 怎么截取啊?Google了1天没找到,正则搞的我头大
      

  2.   

    $str = <<<str......
    str;
    这个是什么意思
    我的源码保存在一个变量$b里 怎么用啊
    $str=$b;  这样不可以 应该怎么用
      

  3.   

    <<<NAME
    data
    NAME
    表示原文档,你可以认为是单双引号,是用来做示例文档的.可以在data间放入自己的内容.
    如果$str=$b后还不能用,那就是$b内容的编码问题了,可以试试$str = iconv('gbk','utf8',$b);
      

  4.   

    已经是全部数据匹配了,刚检查了下,循环出错了,测试数据刚好取了6条,所以没发现.下面已改正
    数据不正常,你应该多检查下编码.for ($i = 0; $i < count($matches[0]); $i++){
      

  5.   

    插入加红没起作用,第一个循环用$matches[0]做限制.
      

  6.   

    可以把所有的\n去掉然后匹配。
    str_replace();
      

  7.   

    那多一个工序,直接改匹配算法不行吗
    改这个preg_match_all('/
                    信息来源
                    :\s(.+)\s.+                #来源#
                    :\s([\d \-\.:]+\.0).+    #时间#
                    :\s(.+)\s.+                #地点#
                    :\s(.+)\s.+                #采集机关#
                    :.+:                
                    \s(.+)\s.+                #违法行为名称#
                    \s(.+)\s.+                #处理地点#
                    \d{4}\-\d{5,}    
                    /Usx', $str, $matches);
      

  8.   

    假设表单内容是<form  method="post" action="http://www.gdgajj.com/cx/wzss/wzss.do" >
    名字: <input name='jc' type='text' value='粤' style='width:20'>
    验证码:   <input type='text' name='randcode2' size='5' value=''>
    <img src="http://www.gdgajj.com/cx/servlet/ImageServlet" >
    <input name='image2' type='submit'>
    </form>
    识别验证码的模块是
    $img="a.jpg" //当前目录下的验证码图片名字
    include ('Valite.php');
    $valite = new Valite();
    $valite->setImage($img);
    $valite->getHec();
    $ert = $valite->run();//$ert就是识别出来的数字提交表单我用snoopyinclude "Snoopy.class.php";
    $snoopy = new Snoopy;
    $submit_url = "http://www.gdgajj.com/cx/wzss/wzss.do";
    $submit_vars["jc"] = "amiga";
    $submit_vars["randcode2"] = $ert;
    $snoopy->submittext($submit_url,$submit_vars);现在的问题是:我如何获取验证码

     $snoopy->fetch("http://www.gdgajj.com/cx/servlet/ImageServlet");
    还是用什么,已确保获取验证码的时候,他们服务器的session已经记录了.
    如何把我发的这几段代码链接起来.
    "识别验证码的模块"和"模拟提交表单的模块"怎样结合起来?
      

  9.   


    $im = imagecreatefromjpeg('http://www.gdgajj.com/cx/servlet/ImageServlet');
    imagejpeg($im, 'a.jpg');//这样保存图片,然后用那个程序解析出数字,再然后用snoopy提交
      

  10.   

    请问这样一个字符串$str$str='[0,"通信与信息工程学院","","","","",3,"","","",-1,2,"通信工程","","","",3,"","pubStuKebiao.php?zyh=0101","frameList",2,
    "电子信息工程","","","",3,"","pubStuKebiao.php?zyh=0102","frameList",2,"电子信息科学与技术","","","",3,"","pubStuKebiao.php?
    zyh=0103","frameList",2,"信息工程","","","",3,"","pubStuKebiao.php?zyh=0104","frameList",2,"广播电视工程","","","",3,"","pubS
    tuKebiao.php?zyh=0105","frameList",2,"通信与信息类","","","",3,"","pubStuKebiao.php?zyh=0114","frameList",2,"通信与信息类实验
    班","","","",3,"","pubStuKebiao.php?zyh=0118","frameList",2,"通信学院卓越班","","","",3,"","pubStuKebiao.php?zyh=0190","frameList"
    ,2,"通信学院IT精英班","","","",3,"","pubStuKebiao.php?zyh=0191","frameList",2,"通信工程国际实验班","","","",3,"","pubStuKebiao.php
    ?zyh=0192","frameList",2,"电子信息工程(通信技术方向)","","","",3,"","pubStuKebiao.php?zyh=2003","frameList",2,"电子信息工程(通信技
    术)","","","",3,"","pubStuKebiao.php?zyh=5101","frameList",2,"电子信息工程(应用电子技术)","","","",3,"","pubStuKebiao.php?zyh=5102","
    frameList",2,"电子信息工程类(实验班)","","","",3,"","pubStuKebiao.php?zyh=5109","frameList",1,0,"光电工程学院","","","","",3,"","",""
    ,-1,2,"光信息科学与技术","","","",3,"","pubStuKebiao.php?zyh=0201","frameList",2,"微电子学","","","",3,"","pubStuKebiao.php?zyh=0202"
    ,"frameList",2,"电子科学与技术","","","",3,"","pubStuKebiao.php?zyh=0203","frameList",2,"电子工程类","","","",3,"","pubStuKebiao.php
    ?zyh=0211","frameList",2,"微电子工程实验班","","","",3,"","pubStuKebiao.php?zyh=0219","frameList",1,0,"经济管理学院","","","","",3,
    "","","",-1,2,"信息管理与信息系统","","","",3,"","pubStuKebiao.php?zyh=0301","frameList",2,"会计学","","","",3,"","pubStuKebiao.php
    ?zyh=0302","frameList",2,"经济学","","","",3,"","pubStuKebiao.php?zyh=0303","frameList",2,"市场营销","","","",3,"","pubStuKebiao.ph
    p?zyh=0304","frameList",2,"工商管理","","","",3,"","pubStuKebiao.php?zyh=0305","frameList",2,"电子商务","","","",3,"","pubStuKebiao
    .php?zyh=0306","frameList",2,"工程管理","","","",3,"","pubStuKebiao.php?zyh=0308","frameList",2,"信息管理类","","","",3,"","pubStuK
    ebiao.php?zyh=0311","frameList",2,"工商管理类","","","",3,"","pubStuKebiao.php?zyh=0312","frameList",2,"国际化会计人才培养实验班","
    ","","",3,"","pubStuKebiao.php?zyh=0318","frameList",2,"工商管理类实验班","","","",3,"","pubStuKebiao.php?zyh=0390","frameList",2,"
    经济学实验班","","","",3,"","pubStuKebiao.php?zyh=0391","frameList",2,"市场营销(企业营销与管理方向)","","","",3,"","pubStuKebiao.
    php?zyh=2004","frameList",2,"信息管理与信息系统","","","",3,"","pubStuKebiao.php?zyh=2009","frameList",1,0,"计算机科学与技术学院","
    ","","","",3,"","","",-1,2,"计算机科学与技术","","","",3,"","pubStuKebiao.php?zyh=0401","frameList",2,"地理信息系统","","","",3,"",
    "pubStuKebiao.php?zyh=0402","frameList",2,"网络工程","","","",3,"","pubStuKebiao.php?zyh=0403","frameList",2,"信息安全","","","",3,
    "","pubStuKebiao.php?zyh=0404","frameList",2,"智能科学与技术","","","",3,"","pubStuKebiao.php?zyh=0405","frameList",2,"计算机与智能
    科学类","","","",3,"","pubStuKebiao.php?zyh=0412","frameList",2,"计算机与智能科学类实验班","","","",3,"","pubStuKebiao.php?zyh=0418
    ","frameList",2,"计算机学院卓越班","","","",3,"","pubStuKebiao.php?zyh=0491","frameList",2,"计算机科学与技术","","","",3,"","pubStu
    Kebiao.php?zyh=2001","frameList",2,"计算机科学与技术(计算机应用)","","","",3,"","pubStuKebiao.php?zyh=5301","frameList",2,"计算机科
    学与技术(网络技术)","","","",3,"","pubStuKebiao.php?zyh=5302","frameList",2,"计算机科学与技术(信息安全)","","","",3,"","pubStuKebi
    ao.php?zyh=5303","frameList",2,"计算机科学与技术类(实验班)","","","",3,"","pubStuKebiao.php?zyh=5309","frameList",1,0,"外国语学院"
    ,"","","","",3,"","","",-1,2,"英语","","","",3,"","pubStuKebiao.php?zyh=0501","frameList",2,"英语(商贸)","","","",3,"","pubStuKebia
    .php?zyh=5401","frameList",1,0,"生物信息学院","","","","",3,"","","",-1,2,"生物医学工程","","","",3,"","pubStuKebiao.php?zyh=0601","
    frameList",2,"生物技术","","","",3,"","pubStuKebiao.php?zyh=0602","frameList",2,"中药学","","","",3,"","pubStuKebiao.php?zyh=0603","
    frameList",2,"制药工程","","","",3,"","pubStuKebiao.php?zyh=0604","frameList",2,"生物信息学","","","",3,"","pubStuKebiao.php?zyh=060
    5","frameList",2,"生物技术与制药类","","","",3,"","pubStuKebiao.php?zyh=0611","frameList",2,"生物技术(生物信息学方向)","","","",3,
    "","pubStuKebiao.php?zyh=0615","frameList",2,"生物与制药类实验班","","","",3,"","pubStuKebiao.php?zyh=0690","frameList",1,0,"法学院",
    "","","","",3,"","","",-1,2]';正则怎样写能达到这样的二维数组