Error in regular expressions- Syntax error in regexp pattern. (U_REGEX_RULE_SYNTAX)

743 views
Skip to first unread message

Sharang Bhat

unread,
Nov 3, 2015, 12:59:47 AM11/3/15
to ShinyApps Users
I am building a sentiment miner for Twitter. The program was working fine before I upgraded R to R 3.2.2. The error is as follows

Error in stri_replace_all_regex(string, pattern, replacement, vectorize_all = vec,  : 
  Syntax error in regexp pattern. (U_REGEX_RULE_SYNTAX)
Error in stri_replace_all_regex(string, pattern, replacement, vectorize_all = vec,  : 
  Syntax error in regexp pattern. (U_REGEX_RULE_SYNTAX)
Error in stri_replace_all_regex(string, pattern, replacement, vectorize_all = vec,  : 
  Syntax error in regexp pattern. (U_REGEX_RULE_SYNTAX)

The code associated with the error is this (I'm assuming)

tweets <- str_replace_all(tweets," "," ")
# Get rid of URLs
tweets <- str_replace_all(tweets, "http://t.co/[a-z,A-Z,0-9]*{8}","")
# Take out retweet header, there is only one
tweets <- str_replace(tweets,"RT @[a-z,A-Z]*: ","")
# Get rid of hashtags
tweets <- str_replace_all(tweets,"#[a-z,A-Z]*","")
# Get rid of references to other screennames

Tareef Kawaf

unread,
Nov 3, 2015, 6:42:19 AM11/3/15
to Sharang Bhat, ShinyApps Users
Hi Sharang,
This is more of an R question than a shinyapps.io question.  I would either post it to stackOverflow, or you could consider filing a bug for the issue with a reproducible example here: https://github.com/hadley/stringr

Best,
Tareef

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/815be477-07d6-4a4e-9b56-782dd629821c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages