You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is something I experienced using R, which includes a copy of TRE which dates back to 2009. Sorry if it has been fixed since then.
The idea is that I want to remove the inner tag in the following expression, while keeping the outer one. I do not know beforehand what may appear in the tags after "class=" and "style=".
"ab"
Thus, the expected result is:
"ab"
The expression I tried is the following, and it works with PCRE. With TRE, the first .* is always greedy:
(gsub() matches the first pattern against the third string and replaces them with the second pattern.)
gsub("(?U)(._)", "\1", "ab")
[1] "b"
gsub("(._?)", "\1", "ab")
[1] "b"
// Use PCRE instead of TRE
gsub("(._?)", "\1", "ab", perl=TRUE)
[1] "ab"
Moreover, it looks like the parentheses around the second .* change the result:
gsub("(._?)", "", "ab")
[1] ""
gsub("._?", "", "ab")
[1] "b"
gsub("(?U)(._)", "", "ab")
[1] ""
gsub("(?U)._", "", "ab")
[1] "b"
The text was updated successfully, but these errors were encountered:
This is something I experienced using R, which includes a copy of TRE which dates back to 2009. Sorry if it has been fixed since then.
The idea is that I want to remove the inner tag in the following expression, while keeping the outer one. I do not know beforehand what may appear in the tags after "class=" and "style=".
Thus, the expected result is:
The expression I tried is the following, and it works with PCRE. With TRE, the first .* is always greedy:
(gsub() matches the first pattern against the third string and replaces them with the second pattern.)
// Use PCRE instead of TRE
Moreover, it looks like the parentheses around the second .* change the result:
The text was updated successfully, but these errors were encountered: