I would like to create a pattern for the following text string using the rebus package in R.
My attempts are below, but I am not able to remove the square brackets and return the same pattern using str_view(). Is there perhaps a tool / function that can replicate regex expressions using the rebus package? Rebus is a lot easier to read and makes sense when sharing code with someone that might not be familiar with regex.
Pattern with regex:
pattern = "http.*for-sale.*5857"
I am trying to replicate this with the rebus package:
pattern_rebus = "http" %R% zero_or_more(ANY_CHAR) %R% "for-sale" %R% zero_or_more(ANY_CHAR) %R% "5857"
as.regex(pattern_rebus)
<regex> http[.]*for-sale[.]*5857