I want to get all stock tickers/abbreviations from a page. But when I perform the web scrape the page, some unwanted tickers came with it, basically they all end with F or (space) for example "BDLL4F " or "QCOM34F". I succeeded to remove them using gsub() and regex.
stocktickers = c("PETR4", "VALE3", "MDNE3", "BDLL4F ", "QCOM34F", "SANB11", "USIM5")
stocktickers = gsub("(.*[ F]$)","NULL",stocktickers)
stocktickers = stocktickers[stocktickers!="NULL"]
> stocktickers
[1] "PETR4" "VALE3" "MDNE3" "SANB11" "USIM5"
Is there any function that would possibly drop the string from the array if the value begins or ends with a specified character or integer?