{"action":"closed","issue":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/493","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/493/comments","events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/493/events","html_url":"https://github.com/joel-costigliola/assertj-core/issues/493","id":108880442,"number":493,"title":"Add partial regex match assertion","user":{"login":"kozhevnikov","id":417553,"avatar_url":"https://avatars.githubusercontent.com/u/417553?v=3","gravatar_id":"","url":"https://api.github.com/users/kozhevnikov","html_url":"https://github.com/kozhevnikov","followers_url":"https://api.github.com/users/kozhevnikov/followers","following_url":"https://api.github.com/users/kozhevnikov/following{/other_user}","gists_url":"https://api.github.com/users/kozhevnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/kozhevnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kozhevnikov/subscriptions","organizations_url":"https://api.github.com/users/kozhevnikov/orgs","repos_url":"https://api.github.com/users/kozhevnikov/repos","events_url":"https://api.github.com/users/kozhevnikov/events{/privacy}","received_events_url":"https://api.github.com/users/kozhevnikov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-29T14:22:07Z","updated_at":"2015-10-19T10:11:56Z","closed_at":"2015-10-19T10:11:56Z","body":"Any chance a partial pattern match (i.e. typical non-Java version without implied `^` and `$`) assert could be added? I cobbled together the wrapper below to use in the meantime.\r\n\r\n[Here is Hamcrest-flavoured example](https://github.com/derari/cthul/blob/master/matchers/src/main/java/org/cthul/matchers/object/ContainsPattern.java), with `matchesPattern` and `containsPattern`.\r\n```java\r\nimport java.util.regex.Pattern;\r\n\r\npublic class Assertions extends org.assertj.core.api.Assertions {\r\n    public static StringAssert assertThat(String actual) {\r\n        return new StringAssert(actual);\r\n    }\r\n\r\n    public static class StringAssert extends org.assertj.core.api.StringAssert {\r\n        protected StringAssert(String actual) {\r\n            super(actual);\r\n        }\r\n\r\n        /*@Override\r\n        public org.assertj.core.api.StringAssert matches(Pattern pattern) {\r\n            return super.matches(pattern);\r\n        }\r\n\r\n        @Override\r\n        public org.assertj.core.api.StringAssert matches(CharSequence regex) {\r\n            return super.matches(regex);\r\n        }*/\r\n\r\n        public StringAssert contains(Pattern pattern) {\r\n            if (pattern == null)\r\n                throw new NullPointerException(\"The regular expression pattern to find should not be null\");\r\n\r\n            isNotNull();\r\n\r\n            if (!pattern.matcher(actual).find())\r\n                failWithMessage(\"%nExpecting:%n %s%nto contain pattern:%n %s\", actual, pattern.pattern());\r\n\r\n            return this;\r\n        }\r\n\r\n        public StringAssert containsPattern(CharSequence regex) {\r\n            if (regex == null)\r\n                throw new NullPointerException(\"The regular expression pattern to find should not be null\");\r\n            return contains(Pattern.compile(regex.toString()));\r\n        }\r\n    }\r\n}\r\n```"}}