{"action":"created","issue":{"url":"https://api.github.com/repos/languagetool-org/languagetool/issues/1249","repository_url":"https://api.github.com/repos/languagetool-org/languagetool","labels_url":"https://api.github.com/repos/languagetool-org/languagetool/issues/1249/labels{/name}","comments_url":"https://api.github.com/repos/languagetool-org/languagetool/issues/1249/comments","events_url":"https://api.github.com/repos/languagetool-org/languagetool/issues/1249/events","html_url":"https://github.com/languagetool-org/languagetool/issues/1249","id":377852595,"node_id":"MDU6SXNzdWUzNzc4NTI1OTU=","number":1249,"title":"Unexpected behaviour with regexp_replace","user":{"login":"MikeUnwalla","id":5816160,"node_id":"MDQ6VXNlcjU4MTYxNjA=","avatar_url":"https://avatars0.githubusercontent.com/u/5816160?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeUnwalla","html_url":"https://github.com/MikeUnwalla","followers_url":"https://api.github.com/users/MikeUnwalla/followers","following_url":"https://api.github.com/users/MikeUnwalla/following{/other_user}","gists_url":"https://api.github.com/users/MikeUnwalla/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeUnwalla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeUnwalla/subscriptions","organizations_url":"https://api.github.com/users/MikeUnwalla/orgs","repos_url":"https://api.github.com/users/MikeUnwalla/repos","events_url":"https://api.github.com/users/MikeUnwalla/events{/privacy}","received_events_url":"https://api.github.com/users/MikeUnwalla/received_events","type":"User","site_admin":false},"labels":[{"id":51266621,"node_id":"MDU6TGFiZWw1MTI2NjYyMQ==","url":"https://api.github.com/repos/languagetool-org/languagetool/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-06T13:43:56Z","updated_at":"2018-11-06T14:56:32Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I think that there is a bug with regexp_replace.\r\n\r\nThe example is based on the rule in http://wiki.languagetool.org/tips-and-tricks#toc15.\r\n\r\n```\r\n<rule id=\"TOC15\" name=\"TOC15\">\r\n<pattern case_sensitive=\"yes\">\r\n    <marker>\r\n        <token>Bar</token>\r\n    </marker>\r\n    <token/>\r\n</pattern>\r\n<message>Change to <suggestion><match no=\"1\" regexp_match=\".*\" regexp_replace=\"bar\" case_conversion=\"alllower\"/></suggestion></message>\r\n<example correction=\"bar\">Is this a good <marker>Bar</marker>?</example>\r\n</rule>\r\n```\r\n\r\nTestrules gives this warning:\r\n```\r\nRunning pattern rule tests for English... Exception in thread \"main\" java.lang.AssertionError: English: Incorrect sugges\r\ntions: [bar] != [barbar] for rule TOC15[1] on input: Is this a good Bar? expected:<[bar]> but was:<[barbar]>\r\n        at org.junit.Assert.fail(Assert.java:88)\r\n```\r\n\r\nIf I put `<example correction=\"barbar\">`, testrules is happy.\r\n"},"comment":{"url":"https://api.github.com/repos/languagetool-org/languagetool/issues/comments/436281239","html_url":"https://github.com/languagetool-org/languagetool/issues/1249#issuecomment-436281239","issue_url":"https://api.github.com/repos/languagetool-org/languagetool/issues/1249","id":436281239,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjI4MTIzOQ==","user":{"login":"Discostu36","id":30999326,"node_id":"MDQ6VXNlcjMwOTk5MzI2","avatar_url":"https://avatars0.githubusercontent.com/u/30999326?v=4","gravatar_id":"","url":"https://api.github.com/users/Discostu36","html_url":"https://github.com/Discostu36","followers_url":"https://api.github.com/users/Discostu36/followers","following_url":"https://api.github.com/users/Discostu36/following{/other_user}","gists_url":"https://api.github.com/users/Discostu36/gists{/gist_id}","starred_url":"https://api.github.com/users/Discostu36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Discostu36/subscriptions","organizations_url":"https://api.github.com/users/Discostu36/orgs","repos_url":"https://api.github.com/users/Discostu36/repos","events_url":"https://api.github.com/users/Discostu36/events{/privacy}","received_events_url":"https://api.github.com/users/Discostu36/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T14:56:32Z","updated_at":"2018-11-06T14:56:32Z","author_association":"MEMBER","body":"This certainly shouldn't happen but I also don't really understand the need for this feature. This does work:\r\n\r\n```\r\n<rule id=\"TOC15\" name=\"TOC15\">\r\n<pattern case_sensitive=\"yes\">\r\n    <marker>\r\n        <token>Bar</token>\r\n    </marker>\r\n    <token/>\r\n</pattern>\r\n<message>Change to <suggestion><match no=\"1\" case_conversion=\"alllower\"/></suggestion></message>\r\n<example correction=\"bar\">Is this a good <marker>Bar</marker>?</example>\r\n</rule>\r\n```\r\n\r\nSo why use regexp_replace for that?"}}
{"actor":{"display_login":"Discostu36"}}