Index: nr_autocomplete.module =================================================================== --- nr_autocomplete.module (revision 37) +++ nr_autocomplete.module (working copy) @@ -33,7 +33,7 @@ $field = $fields[$field_name]; // Pattern from taxonomy_autocomplete() - $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x'; + $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"(?> [^",]*)|(?: [^",]*))%x'; preg_match_all($regexp, $string, $matches); $array = $matches[1]; @@ -103,8 +103,7 @@ foreach ($items as $delta => $item) { if (!empty($item['nid'])) { $n = db_result(db_query(db_rewrite_sql('SELECT n.title FROM {node} n WHERE n.nid = %d'), $item['nid'])); - $n .= ' [nid:'. $item['nid'] .']'; - $items[$delta]['default node_name'] = nr_autocomplete_encode($n); + $items[$delta]['default node_name'] = nr_autocomplete_encode($n) . ' [nid:'. $item['nid'] .']'; } } break; @@ -229,7 +228,7 @@ function nr_autocomplete_parse_input($typed_input) { // This regexp allows the following types of user input: // this, "somecmpany, llc", "and ""this"" w,o.rks", foo bar - $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x'; + $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"(?> [^",]*)|(?: [^",]*))%x'; preg_match_all($regexp, $typed_input, $matches); return array_unique($matches[1]); }