cloudify-cosmo / repex

sed on steroids
Apache License 2.0
10 stars 3 forks source link

Add the number of replacement occurrences for each 'replace' that found in a file #36

Open limor-gs opened 8 years ago

limor-gs commented 8 years ago

When repex find more than one occurrence of the 'replace' string - it should replace it only once (in the new repex version). It will be helpfull that the log will contain the number of 'replace' occurrences, so it will be clear why in some cases the sum of the numbers of replacements is greater than the specific 'Replacing ...' strings.

nir0s commented 7 years ago

This is a very complicated feature to provide. The user defines a regular expression which matches a set of static expressions in the file. Adding the ability to also see how many of each were found isn't trivial as python's re doesn't provide such functionality. I'll keep this open and if additional people ask for this functionality, i'll add it.