You are here: Regular Expression - Can't match blank space - why not? « PHP Language « IT news, forums, messages
Regular Expression - Can't match blank space - why not?

Posted by cluthz on 05/22/07 01:28

Help,

I'm having this strange problem where my regular expression will not match
blank space.

Obviously I'm doing something wrong, but what?

Lets say I have a string such as

$test = "my example"

then I want to search it for a string
ereg ("\se",$test)

I would expect the above to return true but it returns false.

When I amend it to:
ereg ("e",$test)

I get a true response as expected.

when I try
ereg ("\s",$test)

It returns false. (I would expect true as there is a space in the string).

Please tell me what I'm doing wrong. It's driving me nuts

Thanks in advance.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация