nginx url rewrite with string substitution

Solution 1:

rewrite    ^(.*)substrtocatch(.*)$    $1changedsubstr$2;