{"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":1,"created_at":"2018-11-06T13:43:56Z","updated_at":"2018-11-06T15:51:40Z","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/436302156","html_url":"https://github.com/languagetool-org/languagetool/issues/1249#issuecomment-436302156","issue_url":"https://api.github.com/repos/languagetool-org/languagetool/issues/1249","id":436302156,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjMwMjE1Ng==","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},"created_at":"2018-11-06T15:51:40Z","updated_at":"2018-11-06T15:51:40Z","author_association":"CONTRIBUTOR","body":"I found the problem because I was working on a more complex rule in which I wanted to change the case of a suggestion.\r\n\r\nThe feature is necessary because \"LT automatically adjusts the case of suggestions if they are added as plain text. If you want to suppress the default behavior, you need to use the match element. If you're not just changing the case but also changing the word, then you can use the following workaround:\""}}
{"actor":{"display_login":"MikeUnwalla"}}