Results 1 to 5 of 5

Thread: RegExp

  1. #1

    Default RegExp

    Hi, sorry for the question as it cannot be applied to none of the forums
    I have a question about RegExp.

    I have a text something like:
    PHP Code:
    <script language="javascript">

              var 
    id =32582
              
    var reg '2'
              
    region[id] = reg;
      
    </script>
      <option value="32582"  minimum="1">
          <span>Australia</span>

      </option> 
    How can I get by means of RegExp the value, minimum from option and country form span which is inside the option?

    I was able to get only value and minimum values by means of two separate RegExp but still cannot get country.
    PHP Code:
      $pattern "!<option[^>]*\svalue=[\"']?(\d{5}+)[\"']?[\"']?[^>]*>!isU";  //[^>\"'#\s]
      
    preg_match_all($pattern$content$c_code);

    echo 
    "<PRE>";
    print_r($c_code[1]); 
    Any help appreciated.
    Nick

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    Is there any reason you have to use a regex? Give more context.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3

    Default

    I simply need to take the data from a web page. I do not mean steal but copy. The page is a property of ours.

  4. #4

    Default

    Can someone help?

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Chuck that into a div (It doesn't even have to be in the document, just create one), and use DomQuery.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •