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
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts

    What does this string mean?

    Hi guys..

    What does this string mean?

    PHP Code:
    '/top\.location\.replace\(\"http\:\/\/www\.bebo\.com\/SignIn\.jsp"\)/i' 
    i found it in this piece of code

    PHP Code:
        if (preg_match('/top\.location\.replace\(\"http\:\/\/www\.bebo\.com\/SignIn\.jsp"\)/i'$data$matches)) return false
    Thanks

  • #2
    Regular Coder xconspirisist's Avatar
    Join Date
    Jun 2006
    Location
    Great Britain.
    Posts
    138
    Thanks
    1
    Thanked 6 Times in 6 Posts
    That string is a regular expression (aka: regex). It is used to check if a string conforms to a defined format.

    The PHP manual has excellent documentation on the subject; http://uk.php.net/manual/en/book.regex.php

    The function you see in the second code example takes the regex and essentially "searches" the string. More information on the preg_match function can be found in the PHP manual again: http://uk.php.net/manual/en/function.preg-match.php
    If I have been helpful, use the "thank" button - It makes me happy!

    xconspirisist.co.uk - homepage of my online alias
    technowax.net - a community for people interested in all forms of modern technology.

  • #3
    New Coder
    Join Date
    Jun 2009
    Location
    Manipal
    Posts
    45
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Yup, this is regex.
    This searches for
    top.location.replace("http://www.bebo.com/SigIn.jsp")

    It ignores the case as /i is mentioned.


  •  

    Posting Permissions

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