I’m dealing with a simple problem I guess.
I have a Cognos Report that leaves two files in a folder, after that an interface has to pick up one of the files depending on the filename to start running.
The report process asks the user to set a name to the report. For ex. if I choose the name PaymentJournal06.09, it creates these files:
PaymentJournal 06.09-en-us-xml_desc.xml
PaymentJournal 06.09-en-us.xml
I need a regular expression to pick up only the second file. I tried with PaymentJournal*-en-us.xml but it doesn’t work.
You’re very close. The
.is a special character in regular expressions which matches any one character. So where you had the*wildcard, you want a.*or a.+instead. The first matches 0 or more of any character, and the second matches 1 or more, but both should work for this case. Then, the.you used needs to be escaped, like\., because you actually want to match a.there. Putting it all together:PaymentJournal.*-en-us\.xml