Skip to main content
5 events
when toggle format what by license comment
Sep 28, 2017 at 5:19 comment added CAD97 Right. I've been working with other languages' regex whose default are more closely aligned with raw regex definition. I really should remember that matches only matches the full string though, I've debugged that exact thing multiple times now...
Sep 28, 2017 at 3:53 comment added JimB CAD97 - nice call on the case insensitive, but the $ won't work as you suggest because matches() compares against the entire string. You could use find() instead of matches() though. Since we're only checking case on a single character, I'm not convinced that case_insensitive is inherently better in this case. Probably all the same after compilation.
Sep 28, 2017 at 1:26 comment added CAD97 If you're going to suggest using RegEx, use a better RegEx expression: Pattern.compile("s$", Pattern.CASE_INSENSITIVE). That regex says "contains s followed by the end of the string, case insensitively." (Depending on how good the JVM regex engine is, that regex may even reach near-optimal speed.)
Sep 27, 2017 at 23:36 review First posts
Sep 27, 2017 at 23:36
Sep 27, 2017 at 23:33 history answered JimB CC BY-SA 3.0