I must have forgotten something dreadfully simple. How do I limit input (from stdin in this case) so that the first non AlphaNumeric ends input? I fiddled with gets and with $/ to no avail. I know I could do input validation later, and I could (should) normally use buffered input. gets uses the default \n to end input. I'd like to end it at the first non-alpha-numeric. (Ideally, eventually a language specific version would be beautiful to handle unicode codepoint ranges similarly) Any ideas? Or a method that I'm just missing?