Oh, I slightly misunderstood your question, forgive me. In this case, I don't know any better solution than Riales', and I still think an OS-independent regex would be too much trouble for this particular problem.
I'm too lazy to be proud of being impatient.