%~% | R Documentation |
This simplifies the syntax of regular expression matching.
text %~% pattern
text |
text to match against pattern |
pattern |
regular expression pattern (can have subexpressions) |
a list of the same length as text, with lists of matches in each item
match some math expressions:
x <- c('2*x^2','x','3')
x %~% '([0-9]*)[*]?x?(\\^[0-9]+)?'
[[1]]
[1] "2*x^2" "2" "^2"
[[2]]
[1] "x" "" ""
[[3]]
[1] "3" "3" ""
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.