[Gambas-user] Multiline RegExp [slightly OT]
sourceforge-raindog2 at ...94...
Wed Jul 27 14:19:10 CEST 2011
On Wednesday 27 July 2011 07:45, Caveat wrote:
> But if you were to make a commercial product that looked through some
> data, picked out the email addresses (whether it uses regular
> expressions or not to achieve that is irrelevant), high-lighted them and
> allowed the user to perform some action on them... you *could* (in the
> eyes of Apple's lawyers) be infringing on their patent and get pursued
> legally through the courts.
The very first Unix "mail" program did exactly this -- parsing the plain-
text mbox file to find a pattern indicating the start of a message, listing
the messages for the user and allowing the user to select one -- and
predates Apple's patent by about two decades. That they were given it is
sad, but if they were to try to enforce it against someone with enough
money to make it worth their while, it's likely they would lose the patent.
They have many others which are more dangerous, but not as easily used to
subvert a technical discussion into a political one.
As for the original topic, the way I used to implement a regexp that
returned a list of results back in my Gambas days was to write a function
to repeatedly execute the pattern against subsets of the subject string,
advancing the offset after each successful match. I wrote the gb.pcre
component, and if I wrote a mass-match feature in, I've forgotten it. The
only lists it returned were lists of submatches, as in if you searched for
/the (q\S+) (b\S+) (f\S+)/ it would return a list containing the entire
match, "quick", "brown" and "fox".
More information about the User