Skip to content

docs: Fix formatting and discrepancy in README #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ For example, a mobile Wikipedia url looks like this:

To set up a redirect for mobile Wikipedia urls, enter the following:

From: ^http://(.*?)\.m\.wikipedia\.org/(.*)
To: http://$1.wikipedia.org/$2
- From: `^http://(.*?)\.m\.wikipedia\.org/(.*)`
- To: `http://$1.wikipedia.org/$2`

Here's a breakdown of the FROM pattern if you're not familiar with regular
expressions. When we say "matches", that means the redirect will only trigger if
a match occurs.

| Regex | Effect
| ----------------- | ------------------------------------------------------- |
| ^ | starts matching at the beginning of the url |
| http:// | matches "http://" |
| (.*)\. | matches zero or more characters until the next dot and captures it as group $1 |
| m\.wikipedia\.org/ | matches "m.wikipedia.org/" |
| (.*) | matches the rest of the url and captures it in group 2 |
| Regex | Effect
| -------------------- | ------------------------------------------------------- |
| `^` | starts matching at the beginning of the url |
| `http://` | matches "http://" |
| `(.*?)\.` | matches zero or more characters until the next dot and captures it as group $1 |
| `m\.wikipedia\.org/` | matches "m.wikipedia.org/" |
| `(.*)` | matches the rest of the url and captures it in group 2 |

If the URL matches, group $1 will contain the "en" part of the domain, and group
$2 will contain everything after the domain name. So the resulting redirect url
If the URL matches, group `$1` will contain the "en" part of the domain, and group
`$2` will contain everything after the domain name. So the resulting redirect url
in our example will become:

http://en.wikipedia.org/wiki/Regular_expression
Expand Down