Announcement

Collapse
No announcement yet.

Regular expressions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JohnM
    replied
    Originally posted by JohnM
    (if U isn't specified:
    /<i>(.*)</i>/
    will match the first <i> and the last </i>
    with U, it'll function correctly)

    Leave a comment:


  • Dennis Wrenn
    replied
    Thanks

    Leave a comment:


  • leadZERO
    replied
    The outside / /'s are just enclosing the expression, and they can actually be any of a set of characters.

    Leave a comment:


  • Dennis Wrenn
    replied
    thanks... but what are the / / for?

    and what does "Ungreedy" do??

    and how do you use s?



    Thanks,
    Dennis

    PS:

    That tutorial on PHP Builder was a little confusing.

    Leave a comment:


  • JohnM
    replied
    There's a tutorial on PHPBuilder: http://www.phpbuilder.com/columns/dario19990616.php3

    Basic stuff: anything inside ( )'s will be returned for use in the replace part (via \\1, \\2, etc)
    . means any character
    * means 0 or more of the previous
    + means 1 or more of the previous

    then after the closing delimiter

    Code:
    $result = preg_replace("/vBoard/flags","vBulletin",$string);
    s means search
    i means case insensitive
    U means ungreedy.

    (if U isn't specified:
    /<i>(.*)</i>/
    will match the first <i> and the last </i>
    with U, it'll function correctly)

    Leave a comment:


  • Dennis Wrenn
    replied
    Thanks, but I still don't completely understand them...

    I mean.. how do you use them??

    I know how to use ^ and $... but thats it..


    Thanks,
    Dennis

    Leave a comment:


  • leadZERO
    replied
    http://www.php.net/distributions/big....html#ref.pcre
    http://www.php.net/distributions/big...html#ref.regex

    Leave a comment:


  • Dennis Wrenn
    started a topic Regular expressions

    Regular expressions

    Hello,
    Can somebody please explain these to me??

    I can't find very much about them in the PHP manual.


    Thanks,
    Dennis
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X