{"action":"created","issue":{"url":"https://api.github.com/repos/neo4j/neo4j/issues/6734","repository_url":"https://api.github.com/repos/neo4j/neo4j","labels_url":"https://api.github.com/repos/neo4j/neo4j/issues/6734/labels{/name}","comments_url":"https://api.github.com/repos/neo4j/neo4j/issues/6734/comments","events_url":"https://api.github.com/repos/neo4j/neo4j/issues/6734/events","html_url":"https://github.com/neo4j/neo4j/issues/6734","id":141614840,"number":6734,"title":"Regular expression operator surprise + documentation","user":{"login":"aseemk","id":537838,"avatar_url":"https://avatars3.githubusercontent.com/u/537838?v=4","gravatar_id":"","url":"https://api.github.com/users/aseemk","html_url":"https://github.com/aseemk","followers_url":"https://api.github.com/users/aseemk/followers","following_url":"https://api.github.com/users/aseemk/following{/other_user}","gists_url":"https://api.github.com/users/aseemk/gists{/gist_id}","starred_url":"https://api.github.com/users/aseemk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aseemk/subscriptions","organizations_url":"https://api.github.com/users/aseemk/orgs","repos_url":"https://api.github.com/users/aseemk/repos","events_url":"https://api.github.com/users/aseemk/events{/privacy}","received_events_url":"https://api.github.com/users/aseemk/received_events","type":"User","site_admin":false},"labels":[{"id":19073039,"url":"https://api.github.com/repos/neo4j/neo4j/labels/docs","name":"docs","color":"FF69B4","default":false},{"id":299838718,"url":"https://api.github.com/repos/neo4j/neo4j/labels/enhancement","name":"enhancement","color":"eb6420","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-03-17T15:22:02Z","updated_at":"2017-08-29T10:49:03Z","closed_at":"2017-08-29T10:49:03Z","body":"Hi folks,\n\nI was struggling to get a regex query to work, and then discovered that it was because `^` and `$` are implied in Neo4j's regex implementation!\n\n``` cypher\n// This returns false!\nRETURN 'hello' =~ 'e'\n\n// You have to manually say \"anything before and after\":\nRETURN 'hello' =~ '.*e.*'\n```\n\nIs there a reason for this behavior? I'm not familiar with most other databases, but at least for programming languages (plus `grep` etc.), regexes typically _don't_ assume `^` and `$`.\n\n(I wasn't sure about Java, but it _seems_ from online examples that Java is the same as well.)\n\n—\n\nBefore I discovered this, I also tried to look for documentation on this operator, under the \"Syntax\" > \"Operators\" section where I'd expect it, and there's basically none:\n\nhttp://neo4j.com/docs/stable/query-operators.html#query-operators-string\n\nI then searched these issues, and discovered via pull #4833 that it's under `WHERE`:\n\nhttp://neo4j.com/docs/snapshot/query-where.html#query-where-regex\n\nSo consider this feedback to maybe move this documentation to the actual operators section (the `WHERE` section could still link to it), since it applies to more than just `WHERE`.\n\nAnd please also document non-standard behavior like implied `^` and `$`. =)\n\n—\n\nThanks!\n\nP.S. I'm running Neo4j 2.2.8.\n"},"comment":{"url":"https://api.github.com/repos/neo4j/neo4j/issues/comments/325627229","html_url":"https://github.com/neo4j/neo4j/issues/6734#issuecomment-325627229","issue_url":"https://api.github.com/repos/neo4j/neo4j/issues/6734","id":325627229,"user":{"login":"petraselmer","id":9249759,"avatar_url":"https://avatars0.githubusercontent.com/u/9249759?v=4","gravatar_id":"","url":"https://api.github.com/users/petraselmer","html_url":"https://github.com/petraselmer","followers_url":"https://api.github.com/users/petraselmer/followers","following_url":"https://api.github.com/users/petraselmer/following{/other_user}","gists_url":"https://api.github.com/users/petraselmer/gists{/gist_id}","starred_url":"https://api.github.com/users/petraselmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petraselmer/subscriptions","organizations_url":"https://api.github.com/users/petraselmer/orgs","repos_url":"https://api.github.com/users/petraselmer/repos","events_url":"https://api.github.com/users/petraselmer/events{/privacy}","received_events_url":"https://api.github.com/users/petraselmer/received_events","type":"User","site_admin":false},"created_at":"2017-08-29T10:49:03Z","updated_at":"2017-08-29T10:49:03Z","body":"@aseemk Circling back on this issue: the Cypher chapter has undergone a large change in recent months. These two links: [all ops at a glance](https://neo4j.com/docs/developer-manual/preview/cypher/syntax/operators/#query-operators-summary) and [string ops](https://neo4j.com/docs/developer-manual/preview/cypher/syntax/operators/#query-operators-string) should now reflect the gist of your suggestions. \r\n\r\nMoreover, the provided example (in second link) implicitly illustrates the implied usage of `^` and `$`.\r\n\r\nI will therefore close this issue."}}
{"actor":{"display_login":"petraselmer"}}