0

How do you do a regex gsub for removing all terms from a string before the first number?

Regex is the bane of my existance. I know I'm close:

houston$address1 <- gsub("\\{num}.*","",houston$address1)

Happy to award the points to first to help me out. Cheers.

Neal Barsch
  • 2,810
  • 2
  • 13
  • 39

1 Answers1

1

I would say it is something like:

^.*?(?=[0-9])

Or simpler

^[^0-9]*
Dalorzo
  • 19,834
  • 7
  • 55
  • 102