So the official documentation says absolutely nothing about the tilde sign (~
) used in regexp patterns, for example as in the seeCurrentUrlMatches()
function. Yet, it is used extensively in the documentation.
In the exmample, the regexp looks like this:
$I->seeCurrentUrlMatches('~$/users/(\d+)~');
- Without the tilde sign, it gives an error. eg.
grabFromCurrentUrl('(\d+)')
returns:" (\d+)" Fail Nothing to grab. A regex parameter required.
- The end-of-string regexp operator's (
$
) position makes no sense (I presume the dollar sign has a completely different meaning in this context /my guess would be shorthand for the home path/.) - In standard regexp, the
~
captures the character itself
My conclusion is the regexp pattern that Codeception expects from you is clearly non-standard. So what does the ~
and $
do? Where can I find a throughout documentation or article about this?