php regular expression assistance bold a filename

Posted by jason on Stack Overflow See other posts from Stack Overflow or by jason
Published on 2010-04-02T13:38:24Z Indexed on 2010/04/02 13:43 UTC
Read the original article Hit count: 191

Filed under:
|

I am not very good, with regular expression in php I am trying to get a reg_expression to find all file names such as /file-name-here.php and make it bold.

This expression works in Flash but not in php it also doesn't accept the '-' i'm not sure why i can't get it to work with preg_replace

/(https?://)?(www\.)?([a-zA-Z0-9_%]*)\b\.[a-z]{2,4}(\.[a-z]{2})?((/[a-zA-Z0-9_%]*)+)?(\.[a-z]*)?/g

© Stack Overflow or respective owner

Related posts about php

Related posts about expression