preg_match('~"http://(.*)"~iU', $code, $matches);
Your issue was you need delimiters (I chose ~) to use with the pattern. See the preg_match() man page for more information.
More Related Contents:
- PHP preg_match with working regex [duplicate]
- PHP regular expressions: No ending delimiter ‘^’ found in
- Delimiter must not be alphanumeric or backslash and preg_match
- preg_match(): Compilation failed: invalid range in character class at offset
- PHP preg_match to find multiple occurrences
- “Unknown modifier ‘g’ in…” when using preg_match in PHP?
- Optional Whitespace Regex
- PHP – regex to allow letters and numbers only
- PHP preg_match to find whole words
- Replacing Placeholder Variables in a String
- Extracting all values between curly braces regex php
- PHP’s preg_match() and preg_match_all() functions
- Function eregi() is deprecated [duplicate]
- Get repeated matches with preg_match_all()
- Unknown modifier ‘/’ in …? what is it? [duplicate]
- PHP preg_match (.*) not matching past line breaks [duplicate]
- My pattern isn’t matching a ISO style date, why? [duplicate]
- How to search in an array with preg_match?
- Are the PHP preg_functions multibyte safe?
- How to validate a domain name using Regex & PHP?
- Preg_match_all
- Regular expression preg_quote symbols are not detected
- Test if a string is regex
- PHP email validation [duplicate]
- preg_match with international characters and accents
- How to validate that a string only contain lowercase letters?
- How to get the shortest rather than longest possible regex match with preg_match()
- Get non-numeric characters then number on each line of a block of texf
- Detecting a url using preg_match? without http:// in the string
- Regex to match an IP address [closed]