3 ms·
I just went through all the examples, that was awesome! Best tutorial I've seen yet. With this and debuggex, I should be all set to parse HTML with regexes (kid
by zaptheimpaler 14y ago
I just went through all the examples, that was awesome! Best tutorial I've seen yet. With this and debuggex, I should be all set to parse HTML with regexes (kidding).
By the way, could someone explain this to me - do regexes match a string if a part of a string matches the regex, or if the whole string does?
For example, this regex "([+|-]* )(\d+[,|.]* )(\d+)(\.)?(e)?(\d+)" (intended to match decimal/scientific numbers - see http://regexone.com/example/0 http://regexone.com/example/0) matches "720p" on regexone, but fails to match on debuggex. So it seems like it varies depending on some configuration - is that right?
- archangel_one 14y agoThat regex doesn't match 720p on regexone (and shouldn't - it has required spaces in it). You're getting a tick for the bottom item because it's not supposed to match that case. As for your question, it generally depends how they're called - eg. in Python's re module, whether you call search() or match(). You can force a regex to match the entire string by adding ^ and $.