$re = '/^\s*(\w*)=\s?\d/m';
$str = '#!/bin/bash
flavor=${1:-dzen2}
function gmail() {
while true
do
inbox_count=$(wget -q -O- --auth-no-challenge --user=something@gmail.com --password=something \'https://mail.goog$
echo "Gg:$inbox_count"
sleep 60
done
}
function weather() {
while true
do
weather_stat=$($HOME/.config/i3/./weather.sh)
echo "F$weather_stat"
sleep 900
done
}
function time_date() {
while true
do
klocka=$(date +\'%A den %d %B v%V %H:%M\')
echo "S$klocka"
sleep 10
done < <(echo)
}
bspc control --put-status
xtitle -sf "T%s" > "$PANEL_FIFO" &
weather > "$PANEL_FIFO" &
gmail > "$PANEL_FIFO" &
time_date > "$PANEL_FIFO" &
case "$flavor" in
bar)
cat "$PANEL_FIFO" | .config/bspwm/panel_bar | bar
;;
dzen2)
. .config/bspwm/panel_colors
PANEL_HEIGHT=14
FONT_FAMILY=\'Dejavu Sans\'
FONT_SIZE=9
cat "$PANEL_FIFO" | .config/bspwm/panel_dzen2 -f "$FONT_FAMILY" -s "$FONT_SIZE" | \\
dzen2 -h $PANEL_HEIGHT -dock -ta l -title-name panel -fn "${FONT_FAMILY}:pixelsize=${FONT_SIZE}" \\
-fg "$COLOR_FOREGROUND" -bg "$COLOR_BACKGROUND"
;;
esac';
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