All snippets of the tag regexp |
|
1-10 of 21 Entries |
|
|
listing (PHP::Function) |
Created by Marko Schulz at 2010-02-08 22:49:26 |
/**
* This function open a defined directory and read all file into an array $file
* and all directory into an array $dirs. You can filter the search by
* regular expression. To hide hidden files/directories, set the last parameter as True.
*
* ... |
|
rtrim (Bash::Function) |
Created by Marko Schulz at 2010-02-02 00:16:57 |
# *******************************************************
# This function is like the php function rtrim,
# witch removes all spaces in back of a string.
#
# @param <STDIN>|$1 - The string as param or pipe stream
# @return string
#
function rt... |
|
trim (Bash::Function) |
Created by Marko Schulz at 2010-02-02 00:05:09 |
# *******************************************************
# This function is like the php function trim,
# witch removes all spaces in front & back of a string.
#
# @param <STDIN>|$1 - The string as param or pipe stream
# @return string
#
func... |
|
check_width (Perl::Check) |
Created by Marko Schulz at 2010-01-20 14:16:52 |
my $width='101%';
print check_width($width);
# **********************************************************
# Eingabe von Tabellenbreite checken (1=falsch/0=richtig)...
sub check_width {
if ($_[0] !~ /^(([1-9])|([1-9][0-9])|(100))(\%|px)$/)
... |
|
check_url (Perl::Check) |
Created by Marko Schulz at 2010-01-20 14:16:24 |
sub check_url {
# Syntax der WebAdresse checken (http:// - 1=True)...
if ($_[0] =~ /^(f|ht)tp:\/\/.+\..+/) { return 1; } else { return 0; }
} |
|
checkhexa (Perl::Check) |
Created by Marko Schulz at 2010-01-20 14:13:45 |
sub checkhexa {
if ( $_[0] =~ m/^#[0-9a-fA-F]{6}$/ )
{ return 1; } else { return 0; }
} |
|
check_date (Perl::Check) |
Created by Marko Schulz at 2010-01-20 14:13:21 |
sub check_date {
# Datum auf richtiges Format checken (dd.mm.yyyy)...
if ($_[0] =~ /^((0[1-9])|([1-2][0-9])|(3[01]))\.((0[1-9])|(1[0-2]))\.[1-9]\d{3}$/)
{ return 1; } else { return 0; }
} |
|
checkmail (PHP::Check) |
Created by Marko Schulz at 2010-01-20 14:10:34 |
//
// if ( checkmail( $_POST['email'] ) !== True ) {
// echo "ERROR: You have insert an invalid mail address!";
// }
//
// ***************************************************************
// This function check the syntax of an mail address and th... |
|
dirname (Perl::Function) |
Created by Marko Schulz at 2010-01-20 13:49:23 |
sub dirname {
return $1 if ($_[0] =~ m/.*[\/\\](.+)/g);
} |
|
code2html (Perl::Snippets) |
Created by Marko Schulz at 2010-01-20 13:42:41 |
sub code2html {
my $text=shift;
$text =~ s/\[mail\]([^\[]*)\*([^\[]*)\[\/mail\]/<a href=\"mailto:$1\">$2<\/a>/gim;
$text =~ s/\[www\]([^\[]*)\*([^\[]*)\[\/www\]/<a href=\"$1\" target=\"_blank\">$2<\/a>/gim;
$text =~ s/\[b\]([^... |
|
1-10 of 21 Entries |
|
|