toreachdeepak Posted June 29, 2010 Share Posted June 29, 2010 Hi,We are not able to understand the first string to be matched in the below preg_match function'/^exact:[\s\S]*Project Manager:$/'preg_match('/^exact:[\s\S]*Project Manager:$/',$this->selenium->getText("//div[@id=adminreport]/div/form/table/tbody/tr[6]/td[1]/b"))===========================================================================^: Start of string$: end of string1. What is the meaning of exact ?2. If * has a special meaning why it is not coming \* Link to comment Share on other sites More sharing options...
Synook Posted June 29, 2010 Share Posted June 29, 2010 1. What is the meaning of exact ?No special meaning - ^exact tells it to match anything but e, then x, then a, then c, then t.2. If * has a special meaning why it is not coming \*Because the author of the expression wanted to use its special meaning, namely, to match 0 or more whitespace characters with [\s\S]*. Link to comment Share on other sites More sharing options...
jeffman Posted June 29, 2010 Share Posted June 29, 2010 Hrrm. Isn't [\s\S] just the same as a dot? As in, match everything that is a space and everything that is not a space? Link to comment Share on other sites More sharing options...
Synook Posted June 29, 2010 Share Posted June 29, 2010 Heh, indeed it is. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.