[Gambas-user] Multiline RegExp [slightly OT]

Demosthenes Koptsis demosthenesk at ...626...
Wed Jul 27 14:09:46 CEST 2011


Ahhhhh.... i see !

The regular expression and the usage of grep command does this.

The grep command colorize with red the results.
Also if the text is multiline returns in color only the matches of
regexp.

i bring here, in Gambas, the output style of grep command not for the
colorize part but for the capability to return matches from a multiline
subject.

Also i read the patent from Google Patents

http://www.google.com/patents/about?id=aFEWAAAAEBAJ&dq=U.S.+Patent
+No.+5,946,647

and there it says that the data is between a server and a client machine
and some other details.

So i think there is no problem for colorize the result of regexp with
grep or other tool. Except, if there is another patent for colorize
results. i dont know.

While, searching in Google patents i found some patents for regular
expressions like the piped regexp which is patented!

http://www.google.com/patents/about?id=hevCAAAAEBAJ&dq=regular
+expression

also there are some other patents for regexp, search Google patents to
see.

On Wed, 2011-07-27 at 13:45 +0200, Caveat wrote:
> No, as far as I know they haven't managed (yet! lol) to patent the use
> of regular expressions.
> 
> You need to read the text of the patent or my summary here:
> 
> > recognising stuff (phone numbers, email addresses, web urls) in data,
> > > high-lighting it, and allowing a user to interact with it and perform
> > > some action on it.
> 
> So I hope you can see it doesn't patent the use of regular expressions,
> and in fact you wouldn't even need to use regular expressions to
> infringe on the patent.
> 
> 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.
> 
> This is the scary state of the (IMHO) fundamentally broken software
> patent system that now exists.  As a small developer, I know I could
> never afford to take on Apple's lawyers and that probably goes for most
> of us who develop software for a hobby and perhaps sometimes to sell.
> 
> I'm not picking on you particularly, I just happened to notice that what
> you were describing sounded very much like the system Apple has
> described in its patent claim against HTC (which Apple currently appear
> to be winning!).  You can see here for more details:
> http://fosspatents.blogspot.com/2011/07/itc-judge-finds-htc-in-infringement-of.html
> 
> Kind regards,
> Caveat
> 
> 
> On Wed, 2011-07-27 at 14:19 +0300, Demosthenes Koptsis wrote:
> > ok.
> > 
> > But as you say, Apple's lawyers can knock the door of anyone who uses
> > regular expressions.
> > 
> > Is this true?
> > 
> > On Wed, 2011-07-27 at 13:08 +0200, Caveat wrote:
> > > There is no problem in your code, nor in the mail addresses you show as
> > > examples, I was merely trying to point out a problem in the patent
> > > system itself.
> > > 
> > > It seems as if Apple has manged to patent the "novel idea" of
> > > recognising stuff (phone numbers, email addresses, web urls) in data,
> > > high-lighting it, and allowing a user to interact with it and perform
> > > some action on it.
> > > 
> > > As you quite rightly point out, it's not exactly a new idea to go thru a
> > > chunk of data and pick out interesting patterns, nor to allow actions on
> > > those recognised patterns (just look at any modern email client).
> > > 
> > > All I wanted to do was to point out just how silly the software patents
> > > are becoming and that more and more the bleedin' obvious is somehow
> > > getting recognised as a valid patent...
> > > 
> > > ...and if you were to sell your program... what would you do if Apple's
> > > lawyers came knocking on your door asking for money? :-/
> > > 
> > > Kind regards,
> > > Caveat
> > > 
> > > On Wed, 2011-07-27 at 13:48 +0300, Demosthenes Koptsis wrote:
> > > > sorry but i dont understand where is the patent problem.
> > > > 
> > > > There are many regexp which "recognize data" such emails. 
> > > > So i think here is not the problem.
> > > > See for example
> > > > http://regexlib.com/Search.aspx?k=email&c=-1&m=-1&ps=20
> > > > 
> > > > 
> > > > If you mean the @yahoo.com emails this is an example.
> > > > 
> > > > i can change it like 
> > > > user1 at ...2625...
> > > > user2 at ...2625...
> > > > user3 at ...2625...
> > > > user4 at ...2625...
> > > > 
> > > > Is it ok now?
> > > > 
> > > > On Wed, 2011-07-27 at 12:10 +0200, Caveat wrote:
> > > > > I hope you realise that the work you're doing may result in you
> > > > > infringing Apple's patent:
> > > > > 
> > > > > U.S. Patent No. 5,946,647 on a "system and method for performing an
> > > > > action on a structure in computer-generated data" (in its complaint,
> > > > > Apple provides examples such as the recognition of "phone numbers,
> > > > > post-office addresses and dates" and the ability to perform "related
> > > > > actions with that data"; one example is that "the system may receive
> > > > > data that includes a phone number, highlight it for a user, and then, in
> > > > > response to a user's interaction with the highlighted text, offer the
> > > > > user the choice of making a phone call to the number")
> > > > > 
> > > > > This brings home to me just how broken the patent system is!
> > > > > I hope more and more of us programmers start to realise it and do
> > > > > whatever we can to fight against it.  I refused to submit anything for
> > > > > patenting at my last employer, despite their continued efforts to bribe
> > > > > and encourage us to patent anything and everything that could be
> > > > > remotely considered patentable.
> > > > > 
> > > > > If you were to make your program commercially available, and offered the
> > > > > user the possibility to (for example) send a mail to one of the
> > > > > addresses you identified in the textarea, you would (according to Apple)
> > > > > by guilty of patent infringement.  No matter that you've done all the
> > > > > hard work yourself, that you haven't been near any of Apple's code for
> > > > > doing this...
> > > > > 
> > > > > [Sorry to interrupt with this slightly off-topic rant!]
> > > > > 
> > > > > Kind regards,
> > > > > Caveat
> > > > > 
> > > > > 
> > > > > On Wed, 2011-07-27 at 10:34 +0300, Demosthenes Koptsis wrote:
> > > > > > i used also Multiline
> > > > > > http://gambasdoc.org/help/comp/gb.pcre/regexp/multiline?v3
> > > > > > 
> > > > > > and DotAll
> > > > > > http://gambasdoc.org/help/comp/gb.pcre/regexp/dotall?v3
> > > > > > 
> > > > > > with this code
> > > > > > 
> > > > > > -------------------------
> > > > > > ' Gambas class file
> > > > > > 
> > > > > > Private sRegExp As Regexp
> > > > > > 
> > > > > > Public Sub Form_Open()
> > > > > > 
> > > > > >   Me.Center
> > > > > > 
> > > > > > End
> > > > > > 
> > > > > > Public Sub btnMatch_Click()
> > > > > > 
> > > > > >   txtResults.Clear
> > > > > >   
> > > > > >   If IsNull(txtPattern.Text) Or IsNull(txtSubject.Text) Then Return
> > > > > >   
> > > > > >   sRegExp = New Regexp(txtSubject.Text, txtPattern.Text, 4)
> > > > > >   
> > > > > >   If sRegExp.Offset = -1 Then Return
> > > > > >   
> > > > > >   txtResults.Text = sRegExp.Text
> > > > > > 
> > > > > > End
> > > > > > -------------------------
> > > > > > 
> > > > > > 1) The Subject of RegExp is:
> > > > > > 
> > > > > > Here is an email dimos at ...146... and text continues
> > > > > > Here is an email kostas at ...146... and text continues
> > > > > > Here is an email petros at ...146... and text continues
> > > > > > Here is an email paul at ...146... and text continues
> > > > > > 
> > > > > > 2) The Pattern i use is:
> > > > > > (?i)\b[a-z0-9._%\-]+@[a-z0-9._%\-]+\.[A-Z]{2,4}\b
> > > > > > 
> > > > > > 3) The result is only one email:
> > > > > > dimos at ...146...
> > > > > > 
> > > > > > and not the rest of them.
> > > > > > 
> > > > > > 4) if i convert this pattern to grep syntax in terminal, grep gives all
> > > > > > 4 emails. i want to implement a grep like funtcion with Gambas3
> > > > > > 
> > > > > > Thanks!
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > On Wed, 2011-07-27 at 12:45 +1000, Ian Haywood wrote:
> > > > > > > On Wed, Jul 27, 2011 at 8:34 AM, Bruce Bruen <bbruen at ...2308...> wrote:
> > > > > > > > regexp only (ever) works on a line by line basis
> > > > > > > by default yes, but:
> > > > > > > http://gambasdoc.org/help/comp/gb.pcre/regexp/dotall
> > > > > > > 
> > > > > > > this makes the . cover newlines, so a regexp can span multiple lines
> > > > > > > in the string.
> > > > > > > 
> > > > > > > Ian
> > > > > > > 
> > > > > > > ------------------------------------------------------------------------------
> > > > > > > Got Input?   Slashdot Needs You.
> > > > > > > Take our quick survey online.  Come on, we don't ask for help often.
> > > > > > > Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> > > > > > > http://p.sf.net/sfu/slashdot-survey
> > > > > > > _______________________________________________
> > > > > > > Gambas-user mailing list
> > > > > > > Gambas-user at lists.sourceforge.net
> > > > > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > ------------------------------------------------------------------------------
> > > > > Got Input?   Slashdot Needs You.
> > > > > Take our quick survey online.  Come on, we don't ask for help often.
> > > > > Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> > > > > http://p.sf.net/sfu/slashdot-survey
> > > > > _______________________________________________
> > > > > Gambas-user mailing list
> > > > > Gambas-user at lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > > 
> > > 
> > > 
> > > 
> > > ------------------------------------------------------------------------------
> > > Got Input?   Slashdot Needs You.
> > > Take our quick survey online.  Come on, we don't ask for help often.
> > > Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> > > http://p.sf.net/sfu/slashdot-survey
> > > _______________________________________________
> > > Gambas-user mailing list
> > > Gambas-user at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > 
> 
> 
> 
> ------------------------------------------------------------------------------
> Got Input?   Slashdot Needs You.
> Take our quick survey online.  Come on, we don't ask for help often.
> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> http://p.sf.net/sfu/slashdot-survey
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

-- 
Regards,
Demosthenes





More information about the User mailing list