{"action":"opened","issue":{"url":"https://api.github.com/repos/atom/flight-manual.atom.io/issues/452","repository_url":"https://api.github.com/repos/atom/flight-manual.atom.io","labels_url":"https://api.github.com/repos/atom/flight-manual.atom.io/issues/452/labels{/name}","comments_url":"https://api.github.com/repos/atom/flight-manual.atom.io/issues/452/comments","events_url":"https://api.github.com/repos/atom/flight-manual.atom.io/issues/452/events","html_url":"https://github.com/atom/flight-manual.atom.io/issues/452","id":306271270,"number":452,"title":"Regex usage (Find and Replace) poorly explained","user":{"login":"Lilalas","id":10713547,"avatar_url":"https://avatars3.githubusercontent.com/u/10713547?v=4","gravatar_id":"","url":"https://api.github.com/users/Lilalas","html_url":"https://github.com/Lilalas","followers_url":"https://api.github.com/users/Lilalas/followers","following_url":"https://api.github.com/users/Lilalas/following{/other_user}","gists_url":"https://api.github.com/users/Lilalas/gists{/gist_id}","starred_url":"https://api.github.com/users/Lilalas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lilalas/subscriptions","organizations_url":"https://api.github.com/users/Lilalas/orgs","repos_url":"https://api.github.com/users/Lilalas/repos","events_url":"https://api.github.com/users/Lilalas/events{/privacy}","received_events_url":"https://api.github.com/users/Lilalas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-18T19:07:55Z","updated_at":"2018-03-18T19:07:55Z","closed_at":null,"author_association":"NONE","body":"## Why I think the information provided is inadequate:\r\n\r\nRecently, I tried to use the _Regex_ option in _Find and Replace_ for the first time. I did not know how to use it, so I referred to the Flight Manual. The only information I got from there is [this note](https://flight-manual.atom.io/using-atom/sections/find-and-replace/):\r\n\r\n> Note: With a regular expression search, the replacement syntax to refer back to search groups is $1, $2, … $&\r\n\r\nI understood that you can use `.*` to include any arbitrary string of characters into your _search expression_ and then use `$1` to refer back to it in the _replace expression._ So I did this:\r\n\r\n> Find: `text1 .* text2`\r\n> Replace: `text3 $1 text2`\r\n\r\nAnd I wondered why the text covered by “.\\*” was not preserved but instead replaced by “$1”. (I now know that I have to enclose “.\\*” in parentheses like this: `text1 (.*) text2`)\r\n\r\nI did web searches using the terms “atom regex” and “atom regular expression”; they resulted in absolutely nothing that could help with my problem.\r\n\r\nLater I was scrolling through the Wikipedia article on _regular expressions_ (which is very technical and not meant to be a tutorial). I stumbled across [this table](https://en.wikipedia.org/wiki/Regular_expression#POSIX_basic_and_extended) and read the line:\r\n\r\nMetacharacter | Description\r\n-|-\r\n**`( )`** | Defines a marked subexpression. The string matched within the parentheses can be recalled later (see the next entry, `\\n`). A marked subexpression is also called a block or capturing group. **BRE mode requires `\\( \\)`.**\r\n\r\nThat helped me solving my problem from above.\r\n\r\nI still don’t know which other metacharacters you can use with _Find and Replace._\r\n\r\n## My suggestions for improvement:\r\n\r\n* Say which standard of regex syntax is being used so you can look it up yourself\r\n* Link to an external page where you can learn about how to use it\r\n* Include a table with all metacharacters that can be used (like the one from Wikipedia)"}}
{"actor":{"display_login":"Lilalas"}}