Since you want to add this attribute only to custom URLs (those matching /user/*) within your content, you might have to write custom code, as I'm not aware of any module which does this.
You could use hook_preprocess_field() and then execute a regular expression to match your pattern and add the rel="nofollow"
attribute. However, this could be highly inefficient, as you have to do it every time you render a node, besides the fact that parsing HTML with regular expressions is not a bullet-proof solution.
Here it's a very simple example that just adds rel="nofollow" to all links in the body field (you will have to adapt it to use your own regular expression).
/**
* Implements template_preprocess_field().
*/
function MYTHEME_preprocess_field(&$variables) {
if ($variables['element']['#field_name'] == 'body') {
$markup = $variables['items']['0']['#markup'];
$variables['items']['0']['#markup'] = preg_replace('/href=/', 'rel="nofollow" href=', $markup);
}
}
Another alternative would be using the Path Nofollow module, that does something similar:
Specify paths on which a metatag is added to prevent search engines
from indexing the page.
So you could specify the path /user/* and it will add a metatag in the head of your html <meta name="robots" content="noindex">
. As I said, not exactly the same, but it might help or complement your goal.