DECLARE
TIMESTAMP_REGEX STRING DEFAULT r'^\d{4}-\d{1,2}-\d{1,2}[T]\d{1,2}:\d{1,2}:\d{1,2}(.\d{1,6})? *(([+-]\d{1,2}(:\d{1,2})?)|Z|UTC)?$'
DECLARE
DATE_REGEX STRING DEFAULT
r'^\d{4}-(?:[1-9]|0[1-9]|1[012])-(?:[1-9]|0[1-9]|[12][0-9]|3[01])$'
DECLARE
TIME_REGEX STRING DEFAULT r'^\d{1,2}:\d{1,2}:\d{1,2}(.\d{1,6})?$'
Can you please clarify how is this related to R or RStudio?
I would really encourage you to review the following guide, FAQ: Tips for writing R-related questions.
For example, the guide emphasizes asking coding questions with formatted code-chunks and a reprex.
in R the string literals are not of the form r'something' rather they are r'(something)' therefore I would try
r'(^\d{4}-(?:[1-9]|0[1-9]|1[012])-(?:[1-9]|0[1-9]|[12][0-9]|3[01])$)'
I am doing a project involving both bigquery and RStudio. so needed help. I am novice to query language and Rstudio. Please understand. I am sorry for posting a bigquery doubt 
hey it worked. thank you so much