A simple test example hints that you may have copied the code incorrectly:

Code:
//echo -a $regsubex(btw the btw, /\bbtw\b/g, by the way)

returns: by the way the by the way



Are you sure you included the //g switch?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"