Description Usage Arguments Value References Examples
View source: R/econModelSupport.R
Given a string or vector of strings, find and extract all substrings that match the pattern.
1 | regExtract(pattrn, x)
|
pattrn |
String. Regular Expression Pattern. |
x |
vector of Strings. |
vectors of found substrings
Regular expression to extract text between square brackets https://stackoverflow.com/questions/2403122/regular-expression-to-extract-text-between-square-brackets
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
# not including the parentheses
regExtract("(?<=\\()(.*?)(?=\\))", "LIST (c1)")
[1] "c1"
regExtract("(?<=\\()(.*?)(?=\\))", "LIST (((c1)::integer))")
[1] "((c1"
RegExtract("(?<=\\()(\\w+)(?=\\))", "LIST (((c1)::integer))")
[1] "c1"
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.