<?php preg_replace( '/[^a-z][A-Z]/', '', $stringOfText )
Category Archives: Regex
Regex – ignore white space
You can stick optional whitespace characters s*
in between every other character in your regex. Although granted, it will get a bit lengthy.
See this for details
Case sensitive
On regex string add /i for case insensitive or /s for case sensitive.
For example:
[php]
$regex_match = "/(iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Mobile Safari|Android|Opera Mini)/s";
[/php]
and for case insensitive:
[php]
$regex_match = "/(ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle|Safari)/i";
[/php]
Hope it helps!
Detect Mobile by Regex
Mobile phones:
iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Mobile Safari|Android|Opera Mini
Tablets:
ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle|Safari
Old oku settings:
Configuration->Design->Default Cofig:
Current Package Name – Current Package Name
Templates, Skin (Images / CSS), Layout, Default: modern
iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Mobile Safari|Android|Opera Mini – toku
ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle|Safari – modern
Get only numbers from string
preg_replace ( '/[^0-9]/', '', $stringOfText )