outaTiME / grunt-replace

Replace text patterns with applause.
MIT License
411 stars 47 forks source link

Can I use the found pattern in my replace function? #70

Closed geri777 closed 9 years ago

geri777 commented 9 years ago

I have a config.js file containing a version number. I would like to increment this number with each build.

I would like to do something like this:

match: /'version' : '([0-9]+\.[0-9]+\.[0-9]+)'/g,
    replacement: function () {
        var version = $2++;
        return '\'version\' : \'' + version + '\''; 
    }

Is there a possibility to get the match result into the function?

Thanks!

outaTiME commented 9 years ago

hi pal ...

why no use an version number tag an update each time you want ??? something like:

https://github.com/outaTiME/grunt-replace#multiple-matching

i think this way is more clear ...

outaTiME commented 9 years ago

Hi pal, anything about that ?? in will releasing a new applause version soon ...

thks !

outaTiME commented 9 years ago

No feedback, closing from now ...