|
Posted by Rik on 08/15/06 09:57
FFMG wrote:
> Mumia W. wrote:
>> On 08/15/2006 02:17 AM, FFMG wrote:
>>
>> Perhaps use, /a{0,10}1\b/
>>
>> The "\b" indicates a word boundary.
>>
>
> Sorry that will not work, for example,
>
> preg_replace( "/(a){0,10}(10)\b/", "######", "Aaaaa10B" )
>
> Does not work as 'B' is seen as part of the word.
> I need to tell regex that my word boundary is anything other than a
> digit, ([^0-9])
Well, why not tell it that then:
preg_replace('/(a){0,10}10{[^0-9]|$))/s',$string,'ccc$1');
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|