User:TomTheHand/Unit tests for AWB regexes/Length

This section contains regular expressions for formatting units of length.

Replace nautical miles with convert
This task requires three rules. The first strips commas and spaces from large numbers of nautical miles. The second converts standard uses of nautical miles. The third converts adjectival uses of nautical miles. They should not be set up as sub-rules, because then they would only run when we've stripped commas or spaces; we may be dealing with small numbers, so there were no commas to strip, or the article may have simply been written without commas. I don't abbreviate nautical miles, because the symbol to use is disputed, and I feel better writing the unit out than I do using a symbol I don't agree with.

I had originally written just one rule, but I couldn't figure out how to support a number of any length; I had to include separate captures of each group of digits. I set it up to capture the equivalent of a fifth of a light-year, but then I decided that there has to be a way to deal with any number of commas. This is what I came up with.