Regular Expressions (Perl-Compatible)

I found the documentation for regular expressions at php.net.

I read somewhere on the internet to use the pattern modifiers “msU” to match multiline content, but while I understand the ‘m’ and the ‘s’ I don’t understand the ‘U’ very well. I’m not sure what it means to be greedy or ungreedy exactly. But I’ve been using msU pattern modifiers in my regexps that parse the phpjs.org content for import into jsphp.co.