I have this string: “04-2022-7000800426 Pagament Quotes Seguretat Social octubre 2021”
and I need to replace these values “7000800426” and “octubre 2021” wich can be whatever. So when I go find a file, I can do like this: “04-2022-” + (7000800426) + (“Pagament Quotes Seguretat Social”) + (octubre 2021)"
I mean, I need to be able to find the file by changing the first date (“04-2022”)
In this “04-2022-7000800426 Pagament Quotes Seguretat Social octubre 2021”
is ‘04-2022-’ format is always same? and does the string always contain ‘Pagament Quotes Seguretat Social’ ? or the ‘Octubre 2021’ will always be at the last?
The format will be always the same. I made a regex to be able to change the first date, but this number: 7000800426 will change, the same with october2021.
“Pagament Quotes Seguretat Social” will remain the same. Octubre 2021 will change, and this number 7000800426 too. So the output would be: the date i need to look for (04-2022) for example + 7000800426 (that will change everytime) + Pagament Quotes Seguretat Social + octubre 2021 that will also change
maybe I should explain better or I didnt understand.
This is what I have:
var Month = 06
var Year = 2021
var String = “04-2022-7000800426 Pagament Quotes Seguretat Social octubre 2021”
This is the output:
{Month-Year} + {unkown number} + “Pagament Quotes Seguretat Social” + {unkown month} + {unkown year}
I did this to change the first date:
System.Text.RegularExpressions.Regex.Replace( String,“(\d{2}\W\d{2,4})”, Month+ “-” + Year)
And it works but I need another Regex for {unkown number}{unkown month}{unkown year}