I have a complicated URL that can come in two different formats:
http://site.com/app_id/{app_id}/user_id/{user_id}
and also in the format of:
site:app_id:{app_id}:user_id:{user_id}
This is what I have so far:
/http:\/\/site\.com\/app_id\/[\w]+\/user_id\/[\w]+/ig
I have no idea how to write the regular expression to handle the second URL. I tried using (stuff)? but it seems too messy. It would be great to just validate on one OR the other.
Use the “or” operator, a pipe: