> > $new_file =
> preg_replace('/\b(? > ' [tag]$1[/tag] ', $new_file);
> >
Replace the \w+ by [a-bA-Z]+
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thx Erik, it works great except for one detail. It matches numbers too.
Can you fix it so it matches only words please ?
For example:
$file = 'this is a number 1231 test.';
$words = 'test|number';
Result: [tag]this[/tag] [tag]is[/tag] [tag]a[/tag] [tag]nu[/tag]
[sample]number[/sample] [tag]1231[/t
Hello Gregor,
On 13 Jan 2004 at 15:08, Gregor Jaksa wrote:
> hello, i need to replace some words in file with [tag]word[/tag] and other
> words with [sample]word[/sample].
>
> i have a list of words which i need to replace with [sample] tags declared
> like
> $words = 'word1|word2|word3|word4';
3 matches
Mail list logo