code: def urlargs_replace_text_in_arg(urlargs, regexp_argname, text_old, text_new):
      
      out = ""
      # parse URL arguments into a dictionary:
      urlargsdict = parse_qs(urlargs)
      # construct new URL arguments:
      urlargsdictnew = {}
      for key in urlargsdict.keys():
          if re.match(regexp_argname, key):  # replace `arg' by new values
              urlargsdictnew[key] = []
              for parg in urlargsdict[key]:
                  urlargsdictnew[key].append(parg.replace(text_old, text_new))
          else:  # keep old values
              urlargsdictnew[key] = urlargsdict[key]
      # build new URL for this word:
      for key in urlargsdictnew.keys():
          for val in urlargsdictnew[key]:
              out += "&amp;" + key + "=" + quote_plus(val, '')
      if out.startswith("&amp;"):
          out = out[5:]
      return out
docs: Analyze `urlargs' (URL CGI GET query arguments in string form)
         and for each occurrence of argument matching `regexp_argname'
         replace every substring `text_old' by `text_new'.  Return the
         resulting new URL.
  
         Used to be used for search engine's create_nearest_terms_box,
         now it is not used there anymore.  It is left here in case it
         will become possibly useful later.