Have trouble with this and have looked back at previous answers but still seem not to be getting it. Here is the code:
preg_replace('/^.*"([http|https]://test.co/v/.*)/embed.*width=".*$/', '$1', $str);
Am getting a Unknown modifier '/' error.
Looking at the previous answers it looks like I have to deliminate the / that is used in the query so I added a ~ before each forward slash but still the same error. Am guessing I didn't quite understand it... any suggestions appreciated!