#!/usr/bin/env node

var line = "YUI().use\
            (\
             'foo'\
             ,'test',\
            'goo',\
            'moo', function(Y) { weoi woeijwe if () { } then",
    regex = /\)\s*\.\s*use\s*\(([^)]+)/,
    sys = require('sys')
    ;


var matches = regex.exec(line);
console.log(sys.inspect(matches));
if (matches) {
    if (matches[1].match('test')) {
        console.log('found test module!');
        line = line.replace('test', 'jute');
    }
    /*
    var stuff = matches[1].split(',');
    stuff.pop();
    console.log('stuff');
    console.log(sys.inspect(stuff));
    */
    console.log(line);
}
