regular expressions in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benopaul
    New Member
    • Aug 2011
    • 1

    regular expressions in php

    Hi,
    In some regular expressions , I found use of (.*?) in regular expressions. From tutorials , i know use of .,* and ?. But I don't know simultaneous use of these characters. Please give an idea about its.

    With thanks
    Benoy
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Those all mean different things and not related,

    a dot (.) is a character match
    (*) after anything means match it zero to any number of times
    (,) is a separator for a list such a{2,3} means match character a 2 or 3 times (meaning it will match aa and aaa but not "a" or aaaa ... etc.
    (?) makes the preceding character optional. Te?st matches Tst and Test. the "e" is optional. e.g. Test(ing)? matches Test and Testing.

    great resource: http://www.regular-expressions.info

    Cheers,

    Dan

    Comment

    Working...