tags:

views:

32

answers:

1

i have a string. there i need get a one word. this word is between space and point. for example

' 'word.

if it find many same pattern words, i need only first word.

+2  A: 

As far as i understand, you could try :

/\s(\w+)\./

preg_match('/\s(\w+)\./', 'abc. def. ghi.', $m);
echo $m[1],"\n";

output:

def
M42