$re = '/^2$/m';
$str = '# ___ ___ ___ ___ ___
# | _ )_ ) __| / __| __ _ _ ___ ___ _ _ | _ \\___ ___
# | _ \\/ /\\__ \\ \\__ \\/ _| \'_/ -_) -_) \' \\| / -_|_-<
# |___/___|___/__|___/\\__|_| \\___\\___|_||_|_|_\\___/__/
# |_ _| __| \\/ | _ \\ | /_\\_ _| __|
# | | | _|| |\\/| | _/ |__ / _ \\| | | _|
# |_| |___|_| |_|_| |____/_/ \\_\\_| |___|
#
# PLEASE MODIFY FOR YOUR OWN USAGE
# Playfield Screen resolution width/height
1920
1080
# Backglass Screen resolution width/height
1280
1024
# Define Backglass using Display Devicename screen number (\\\\.\\DISPLAY)x or screen coordinates (@x) or screen index (=x)
2
# x position For the backglass relative To the upper left corner Of the Playfield screen
0
# y position For the backglass On the selected display (Normally left at 0)
0
# width/height Of the DMD area In pixels - For 3 screen setup
551
189
# X/Y position Of the DMD area relative To the upper left corner Of the backglass screen - For 3 screen setup
367
813
# Y-flip, flips the LED display upside down
0
# X/Y position pos When StartBackground Is active, relative To upper left corner Of Playfield (\'Small\' Button In the Options)
0
0
# width/height Of the backglass When StartBackground Is active
0
0
# C:\\path\\Frame (The path To the location where you have the background image)
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php