Hi i want pattern for checking no white space.

Here you go, (?! +) that should work.

Member Avatar
^\s

For the example, it depends what you want? preg_match, preg_replace... ?

hi diafol i used this pattern in my this programme.

$string = "Ashok Kumar";

if(preg_match($pattern,$string)){
    echo "Pattern matched";
}else {
    echo "Pattern not matched";
}

but i dint get any result. it give same output for
$string ="AshokKumar" and
$string ="Ashok Kumar"

Here this works

<?php
    if (preg_match("/\s/", "hello there")) {
        echo "Match";
    } else {
        echo "No match";
    }
?>
Member Avatar

but i dint get any result. it give same output for

As I said, it depends on how you want to use it. If you want to just see if there's whitespace - see joshl