rstudio/shiny — pull request #78 by wch (2013-01-22 16:47:21+00:00)
Title: Better CSS unit validation

This method for CSS unit validation allows for `auto`, `400px`, `100%`, and so on. I put the function directly into plotOutput, but it could be moved out if it would be useful for other functions.

Here's some code I used for testing the regex:

```R
library(testthat)
strings <- c("100x", "10px", "1px0", "px", "1px", "5", "%", "5%", "auto", "1auto", "")
results <- c( F, T, F, F, T, F, F, T, T, F, F)

expect_equal(grepl("^(auto|\\d+(%|in|cm|mm|em|ex|pt|pc|px))$", strings), results)
```