PHP code is not correctly showed

Created on 29 April 2009, almost 16 years ago
Updated 23 May 2023, almost 2 years ago

Following code:

function parseUrl ( $url )
{
    $r  = '!(?:(\w+)://)?(?:(\w+)\:(\w+)@)?([^/:]+)?';
    $r .= '(?:\:(\d*))?([^#?]+)?(?:\?([^#]+))?(?:#(.+$))?!i';

    preg_match ( $r, $url, $out );

    return $out;
}

pasted in php tags, it's not viewed properly, even there is no ending tag.

Example:

function parseUrl ( $url )
{
    $r  = '!(?:(\w+)://)?(?:(\w+)\:(\w+)@)?([^/:]+)?';
    $r .= '(?:\:(\d*))?([^#

+)?(?:\?([^#]+))?(?:#(.+$))?!i';

preg_match ( $r, $url, $out );

return $out;
}
?>

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom kenorb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom joachim

    Is the problem that the blank lines of code get turned into P tags?

    It would be helpful if the code sample didn't have the regexes in, as those make it look like there's a nasty problem there!

Production build 0.71.5 2024