how to implement hook_menu so that it recognizes URL like ?q=myterm, as sent by jQuery autocomplete? The jQuery UI autocomplete source string expects the search string to be appended to the URL
as mysite/auto/?q=myterm
(see jquery autocomplete doc)

I have written a module that implements hook_menu and it returns the matching records through JSON.
The expected url is mysite/auto/myterm

How should the hook_menu be written so that it recognizes the ?q=myterm

I am using Drupal 7 and have Clean URL

Edit: can you explain with an example or use this code:
can you help with an example?


  url localhost/myauto/?q=sometext


mymodule_menu(){  
$items['myauto/%'] = array(  
    'title'= 'My example',  
    'page callback' =&gt; 'myexample_auto',   
    'page argument' =&gt; array('1'),  
    'access callback' =&gt; TRUE,  
 );  

myexample_auto($arg){  
...//user $_GET['q'] or drupal_get_query_parameters to get 'sometext' from $arg  
}
hook_menu() don't handle query parameters. It accepts only wildcards.
You can get your query parameters in in your menu callback function and build your own logic by getting parameters as $_GET['q'] or drupal_get_query_parameters()