Exit after running -main
Convert pattern to string before printing