Active
Project:
Rules
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Oct 2012 at 18:10 UTC
Updated:
16 Oct 2012 at 03:10 UTC
Document what kind of regular expressions are used by the regular expression comparison operation.
Are they POSIX? Perl-compatible? Something else? They aren't entirely compatible.
I looked, but found no Web-based documentation. The link to Wikipedia is nice, but not adequate. The best bet would be to change the text (with the Wikipedia link) to say which kind of regular expression it is, then provide a link to a document for that kind of regular expression.
Comments
Comment #1
mitchell commentedI'm pretty sure they're Perl-compatible, because PHP's PCRE library and the RegExr library both support Perl-compatible expressions.
Does that seem right to you? Do you want to make a patch?
I'll try to add a page about regex to the Site Builder Documentation in the near term. I would just rather see some of the regex issues settle before doing it.
Comment #2
Dan Z commentedI've been embarrassed enough times when I was "pretty sure" I knew what my code would do that I'd like some more evidence. Can you trace the code and find the line where it actually does the comparison, so you can confirm?
While you do that, I'll see if I can't figure out GIT and set up a test environment so I can make a proper patch. I know there are docs floating around somewhere explaining all that. Mind pointing me to them and saving me a few minutes of Googling around and/or reading the wrong docs?
Also, don't hesitate to make a doc just because things might change. The beauty of online docs is that you can change them, too. It wouldn't have to be elaborate. A link to the PHP or Perl documentation would cover most of it.
In fact, it might be a good idea to put a list of all the built-in condition tests in the Site Builder docs. (It might be that I just missed it, but I didn't see one.)
Comment #3
mitchell commentedStill reading and such.... in the meantime:
http://php.net/manual/en/reference.pcre.pattern.syntax.php & http://www.php.net/manual/en/pcre.pattern.php should help quite a bit here.
Git documentation >> Making a Drupal patch with Git
It's very verbose, so I recommend loosely following the commands while learning from a separate, simple git guide, like http://rogerdudler.github.com/git-guide/ .
Quickly stated: clone using the project using its version control tab, make your changes, 'git diff > comment#-issue#-issueName.patch', upload patch.
Comment #4
mitchell commentedThe function is preg_match(), so do you just want to add a link to PCRE and a quick explanation of the syntax, like http://www.php.net/manual/en/intro.pcre.php ?
I started a child page in Site building about how to Compare text, so if you want to take a stab at improving it, that'd be cool. #1336848: How to: match data with regex would be another place to discuss it.
> In fact, it might be a good idea to put a list of all the built-in condition tests in the Site Builder docs.
I started on this for #1092440: Recompile documentation for Rules, so just looking for more volunteers to make a few edits here and there.
My recent attention has been on the Introduction section, so please don't hesitate to adopt a Site Building section.