|
-
regular expressions problem
Hi all,
I want replace all occurances of " dot " by .<br />
I used this code
$clean_db_text = str_replace(".", ".<br />", $clean_db_text);
But , it caused problems , when it find www.domain.com , It replaces them.I don't need that . I only want any other dot to be replaced.
I tried :
$pattern = "[^www]\.[^com]";
$replace = ".<br />";
$clean_db_text = preg_replace($pattern, $replace, $clean_db_text);
But I got the following error :
Warning: preg_replace(): Unknown modifier '\' in D:\xampp\htdocs\alaa\test_regex.php on line 16
Can someone help ?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks