Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Regular Expressions

    Hi

    Please someone help me to build pattern to match "Size: 350.085 MB" from below line

    PHP Code:
    CategoryTV Episodes Size350.085 MB Added2010-12-08 10:45:31 


    Thanks

  • #2
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    Quote Originally Posted by extremed View Post
    Hi

    Please someone help me to build pattern to match "Size: 350.085 MB" from below line

    PHP Code:
    CategoryTV Episodes Size350.085 MB Added2010-12-08 10:45:31 


    Thanks
    PHP Code:
    $string 'Category: TV > Episodes Size: 350.085 MB Added: 2010-12-08 10:45:31';
    preg_match('/[^0-9]([0-9\.]+ MB)/'$string$match);
    echo 
    $match[1]; 

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks poyzn, you are helpful and fast as always


  •  

    Posting Permissions

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