see <- function(rx) str_view("abc ABC 123\t.!?\\(){}\n", rx)

1Many base R functions require classes to be wrapped in a second set of [ ],
e.g.  [[:digit:]]  string  
(type this)  |  regex   
(to mean this)  |  matches   
(which matches this)  |  example  |  example output (highlighted characters are in <>)   
---|---|---|---|---  
|  ` a (etc.) ` |  ` a (etc.) ` |  ` see("a") ` | 
    
    
    <a>bc ABC 123\t.!?\(){}\n  
  
` \\. ` |  ` \. ` |  ` . ` |  ` see("\\.")`` ` | 
    
    
    abc ABC 123\t<.>!?\(){}\n  
  
` \\! ` |  ` \! ` |  ` ! ` |  ` see("\\!") ` | 
    
    
    abc ABC 123\t.<!>?\(){}\n  
  
` \\? ` |  ` \? ` |  ` ? ` |  ` see("\\?") ` | 
    
    
    abc ABC 123\t.!<?>\(){}\n  
  
` \\\\ ` |  ` \\ ` |  ` \ ` |  ` see("\\\\") ` | 
    
    
    abc ABC 123\t.!?<\>(){}\n  
  
` \\( ` |  ` \( ` |  ` ( ` |  ` see("\\(") ` | 
    
    
    abc ABC 123\t.!?\<(>){}\n  
  
` \\) ` |  ` \) ` |  ` ) ` |  ` see("\\)") ` | 
    
    
    abc ABC 123\t.!?\(<)>{}\n  
  
` \\{ ` |  ` \{ ` |  ` { ` |  ` see("\\{") ` | 
    
    
    abc ABC 123\t.!?\()<{>}\n  
  
` \\} ` |  ` \} ` |  ` } ` |  ` see("\\}") ` | 
    
    
    abc ABC 123\t.!?\(){<}>\n  
  
` \\n ` |  ` \n ` |  new line (return)  |  ` see("\\n") ` | 
    
    
    abc ABC 123\t.!?\(){}<\n>  
  
` \\t ` |  ` \t ` |  tab  |  ` see("\\t") ` | 
    
    
    abc ABC 123<\t>.!?\(){}\n  
  
` \\s ` |  ` \s ` |  any whitespace   
( ` \S ` for non-whitespaces)  |  ` see("\\s") ` | 
    
    
    abc< >ABC< >123<\t>.!?\(){}<\n>  
  
` \\d ` |  ` \d ` |  any digit   
( ` \D ` for non-digits)  |  ` see("\\d") ` | 
    
    
    abc ABC <1><2><3>\t.!?\(){}\n  
  
` \\w ` |  ` \w ` |  any word character   
( ` \W ` for non-word characters)  |  ` see("\\w") ` | 
    
    
    <a><b><c> <A><B><C> <1><2><3>\t.!?\(){}\n  
  
` \\b ` |  ` \b ` |  word boundaries  |  ` see("\\b") ` | 
    
    
    <>abc<> <>ABC<> <>123<>\t.!?\(){}\n  
  
|  ` [:digit:] ` 1  |  digits  |  ` see("[:digit:]") ` | 
    
    
    abc ABC <1><2><3>\t.!?\(){}\n  
  
|  ` [:alpha:] ` 1  |  letters  |  ` see("[:alpha:]") ` | 
    
    
    <a><b><c> <A><B><C> 123\t.!?\(){}\n  
  
|  ` [:lower:] ` 1  |  lowercase letters  |  ` see("[:lower:]") ` | 
    
    
    <a><b><c> ABC 123\t.!?\(){}\n  
  
|  ` [:upper:] ` 1  |  uppercase letters  |  ` see("[:upper:]") ` | 
    
    
    abc <A><B><C> 123\t.!?\(){}\n  
  
|  ` [:alnum:] ` 1  |  letters and numbers  |  ` see("[:alnum:]") ` | 
    
    
    <a><b><c> <A><B><C> <1><2><3>\t.!?\(){}\n  
  
|  ` [:punct:] ` 1  |  punctuation  |  ` see("[:punct:]") ` | 
    
    
    abc ABC 123\t<.><!><?><\><(><)><{><}>\n  
  
|  ` [:graph:] ` 1  |  letters, numbers, and punctuation  |  ` see("[:graph:]") ` | 
    
    
    <a><b><c> <A><B><C> <1><2><3>\t<.><!><?><\><(><)><{><}>\n  
  
|  ` [:space:] ` 1  |  space characters (i.e. ` \s ` )  |  ` see("[:space:]") ` | 
    
    
    abc< >ABC< >123<\t>.!?\(){}<\n>  
  
|  ` [:blank:] ` 1  |  space and tab (but not new line)  |  ` see("[:blank:]") ` | 
    
    
    abc< >ABC< >123<\t>.!?\(){}\n  
  
|  ` . ` |  every character except a new line  |  ` see(".") ` | 
    
    
    <a><b><c>< ><A><B><C>< ><1><2><3><\t><.><!><?><\><(><)><{><}><\n>  
  
####  Classes