User:Gudeldar/Regexp

From Wikipedia, the free encyclopedia

My regular expressions for lots of stuff

Inline php echos:

<\?php\s+echo[\s(]*((?:@)?(?:'|"|\$))(.*?)('|")?[\s)]\?>

General inline php:

<\?php\s+(.*?)\s*\?>

Template category cleanup:

<includeonly>(.*?)(?<!category[\|])(?:\[\[Category:(.+?)\]\])(.*?)</includeonly>
\|- style="background: #ececec"[\r\n][\r\n]?

[ \t]border="[0-9]" cellpadding="[0-9]" cellspacing="[0-9]"

(?:border=(?:.+?)[ \t\n\r\|]|align=(?:.+?)[ \t\n\r\|]|  |bgcolor=(?:.+?)[ \t\n\r\|])

^(\s*)else\s*\((.*)\)\s*([\r]?[\n])(.*)[\r]?[\n]\1([^\t])

Table formatting:

(\|[^-].+\n)

Presentational attributes:

(?:border|cellpadding|cellspacing|bgcolor)=".*?"


Cleaning up if/else's for Eclipse

(\n\s*if.+\{\s*return.+\s*})\s*else\s*\{\s*(return.+)\s*}