Skip to content

Instantly share code, notes, and snippets.

@aauren
Created March 22, 2012 17:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aauren/2159881 to your computer and use it in GitHub Desktop.
Save aauren/2159881 to your computer and use it in GitHub Desktop.
Regex for Justin
echo "A Bug's Life (1990).mp4" | sed 's/\(.*\)\s([0-9]*)\..*/"\1"/'
With the extension:
echo "A Bug's Life (1990).mp4" | sed 's/\(.*\)\s([0-9]*)\.\(.*\)/"\1.\2"/'
Aaron's better way of creating the file:
echo "A Bug's Life (1990).mp4" | sed 's/\s([0-9]\+)//'
Aaron's better way of creating the folder:
echo "A Bug's Life (1990).mp4" | sed 's/\s([0-9]\+).*//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment