User:TomTheHand/Unit tests for AWB regexes/Speed
From Wikipedia, the free encyclopedia
This section contains regular expressions for formatting units of speed.
Contents |
[edit] Replace km/hr with km/h
| Description | |
|---|---|
| Replace km/hr with km/h | |
| Find | |
| km/hr | |
| Replace with | |
| km/h | |
| Regular expression? | Case sensitive? |
| N | Y |
| Text this regex should modify: | Intended result: |
|
km/hr |
km/h |
[edit] Replace ft/sec(ond) with ft/s
| Description | |
|---|---|
| Replace ft/sec or ft/second with ft/s | |
| Find | |
| \b(\d+)(?:\s| |-)?ft\/s(?:ec(?:ond)?)?\b | |
| Replace with | |
| $1 ft/s | |
| Regular expression? | Case sensitive? |
| Y | N |
| Text this regex should modify: | Intended result: |
|
|
[edit] Replace (k)m/sec(ond) with (k)m/s
| Description | |
|---|---|
| Replace km/sec, km/second, m/sec or m/second with km/s or m/s as appropriate | |
| Find | |
| \b(\d+)(\s| |-)?(k?m)\/s(?:ec(?:ond)?)?\b | |
| Replace with | |
| $1$2$3/s | |
| Regular expression? | Case sensitive? |
| Y | Y |
| Text this regex should modify: | Intended result: |
|
|
[edit] Replace m.p.h. with mph
| Description | |
|---|---|
| Replace m.p.h. with mph | |
| Find | |
| m.p.h. | |
| Replace with | |
| mph | |
| Regular expression? | Case sensitive? |
| N | N |
| Text this regex should modify: | Intended result: |
|
m.p.h. |
mph |

