In an excel file I have a column that is renamed “Portofoliul initial-retrasi (#90)”. On the next run of the flow, this column will be called “Portofoliul initial-retrasi (#91)”. As a rule, every time the flow is run, this column will have +1 added to the digits in the column name. I want to rename this column with “Portofoliul initial-retrasi”, but I can’t. I tried the Column Rename(Regex) node with the following configuration: searchstring: "(?i)Portofoliul\sinitial-retrasi\s(#\d+) " ; replacement: “Portofoliul initial-retrasi” but it does not work.
Is there another option?
You may want to know that when writing regex here on the forum, it is best to mark the regex as “pre-formatted” text, by highlighting it and clicking the pre-formatted text button on the forum toolbar
If you don’t, we cannot easily see what your actual regex was, because some characters get interpreted by the forum software.
So whereas your regex code might have been this: (?i)Portofoliul\s*initial-retrasi\s*\(#\d+\)
without it being marked as pre-formatted, we only see it as this, and some of the \ and * (and potentially other characters) get lost:
(?i)Portofoliul\sinitial-retrasi\s (#\d+)
The regex that @gonhaddock supplied (or a combination of both depending on how specific it needs to be), replacing with $1 should resolve your problem.