Finding posts (possibly) with code block formatting

0

Please login or register to vote for this query.

(click on this box to dismiss)

Looks for questions or answers with more than one line with the leading four spaces indicating code block formatting. Some false positives, e.g. here: https://chemistry.stackexchange.com/questions/31358/born-oppenheimer-adiabaticity/31367#31367

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT p.Id as [Post Link], 'https://chemistry.stackexchange.com/q/' + CAST(p.Id AS nvarchar(10)) AS 'Link'


FROM Posts p

WHERE CHARINDEX(CHAR(10) + '    ', p.Body) > 0
    AND CHARINDEX(CHAR(10) + '    ', p.Body, CHARINDEX(CHAR(10) + '    ', p.Body) + 1) > 0
    AND (p.PostTypeId = 1 OR p.PostTypeId = 2)

ORDER BY p.Id ASC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results