In the Active4D documents there is an example regular expression pattern like this:

$pattern := "|^(http://)?([^/]+)(/4dcgi)?([^?]+)(\?)?(.*)|i"

In this example, I notice the use of the "|" (pipe) around the pattern. Is this an A4D specific thing?

From the PHP perl-compatible regular expression docs:

"The syntax for patterns used in these functions closely resembles Perl. The expression should be enclosed in the delimiters, a forward slash (/), for example. Any character can be used for delimiter as long as it's not alphanumeric or backslash (\). If the delimiter character has to be used in the expression itself, it needs to be escaped by backslash."

Since the pattern in the example above uses a ton of '/' characters, it saves a lot of backslashing to use a different delimiter.

Regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoylibrary.com


_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to