I need a PHP regular expression that matches the beginning of a line but does not end with a phrase. Sort of:
$s = 'top bus stop'; $b = preg_match('/^top.*(?!top)$/', $s);
But one that really works. What do you think?
You had it almost right. But the final statement should be (?<!top) a lookbehind statement using the < prefix. Thus, he really looks at the previous three characters before the $ tag.
(?<!top)
<
$
Source: https://habr.com/ru/post/889895/More articles:Problem with generals and arrays - javaMSChart: shortcut format - .netselectors of the first and third children in the HTML tag "article" are not applied - cssAndroid Intents, questions about setClass () - androidC # Generic - Any way to declare a T has an attribute? - genericsHow to read Shape properties in Visio - c #Play framework JPA: how to implement a one-to-many relationship? - javaDIV "100%" width scrolls on the right side of the page - htmlIn Regex, why "((.How much does it cost to get a code signing certificate from Apple? - macosAll Articles