Jump to content

preg_match issue


toreachdeepak

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...