PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : (PHP) - via php Regex auch nur groß-schreibung erlauben



schneewittchen
29.05.2015, 22:16
Hallo leute,

wie bekomme ich es hin das im titel auch wörter stehn dürfen die nur groß geschrieben wurden



// ----------------------------------------------------------------------------------------------------
// - Parse Word List
// ----------------------------------------------------------------------------------------------------
function ParseWordList($text, $minlength = 3)
{
$result = Array();

if(@preg_match_all('/"(?P<string>[^"\\\\]{' . $minlength . ',}(?:\\\\.[^"\\\\]*)*)"|(?P<words>[^ "]{' . $minlength . ',})/', $text, $regs))
{
if($result = @array_unique(@array_filter($regs['words']) + @array_filter($regs['string'])))
{
@ksort($result, SORT_NUMERIC);
};
};

return($result);
};






else if(!@preg_match('/^([0-9A-Za-z]|\xC3\x84|\xC3\x96|\xC3\x9C|\xC3\xA4|\xC3\xB6|\xC3 \xBC)/', @stripslashes($_POST['title'])))




// - Get Valid Filename
// ----------------------------------------------------------------------------------------------------
function GetValidFilename($filename)
{
$regexp = Array(
'/[^A-Za-z0-9 _\x27\xC4\xD6\xDC\xDF\xE4\xF6\xFC]+/' => ' ',
'/^\s+(.*?)/' => '\\1',
'/(.*?)\s+$/' => '\\1',
'/\s+/' => '-'
);

return(@preg_replace(@array_keys($regexp), @array_values($regexp), ConvertUmlaute(@utf8_decode($filename))));
};





// - Parse Words
// ----------------------------------------------------------------------------------------------------
function ParseWords($text, $minlength = 3)
{
$result = Array();

if(@preg_match_all('/"(?P<string>[^"\\\\]{' . $minlength . ',}(?:\\\\.[^"\\\\]*)*)"|(?P<words>[^ "]{' . $minlength . ',})/', $text, $regs))
{
if($result = @array_unique(@array_filter($regs['words']) + @array_filter($regs['string'])))
{
@ksort($result, SORT_NUMERIC);
};
};

return($result);
};



vielleicht kann einer von euch ja helfen