What you are saying is that after the first part of the regex, there should be something (anything at all) or nothing until the end. As it could be anything (including nothing), why bother? You can safely drop it. There is no need to anchor your regexp on both sides, esp. not with '.*'.
Of course you capture the .* part but you never use the captures, so you can drop all the parentheses as well and gain a bit of speed.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re: mv files from dir1 to dir2
by CountZero
in thread mv files from dir1 to dir2
by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |