KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
trivial regex question (the answer is most probably Java-specific): "#This is a comment in a file".matches("^#") This returns false. As far as I can see, ^ means what it always means and # has no special meaning, so I'd translate ^# as "A '#' at the beginning of the string". Which should match. And so it does, in Perl: perl -e "print '#This is a comment'=~/^#/;" prints "1". So I'm pretty sure the answer is something Java specific. Would somebody please enlighten me? Thank you.
Tags (comma-separated)
Save Edits
Cancel