[Gambas-user] Multiline RegExp [slightly OT]

Caveat Gambas at ...1950...
Wed Jul 27 12:10:00 CEST 2011


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
> 






More information about the User mailing list