Help Regex Language Processing, simple small task



I am able to do some great big things with regex and have done some
really complicated extraction procedures, but what I really need now is
a small function that can take a large text string (from emails)
and match a word, and the text around it.

To whit - I can do this, the problem is, when the words occur more than
once, and are near eachother, it messes up the functioning.

Example: keyword is meeting
"This meeting will be @ 1000 in CR#1, Tuesday 10 January 2006. This
meeting should last no longer than one hour. "

I need to match the 45 chars before and after the word, say, so I do
this:

preg_match_all("/.{0,45}\W($match)\W.{0,45}/is", $string, $match2); //
s for multiline match

This returns only a little bit of what I need though:
[10] => le. This meeting will be @ 1000 in CR#1, Tuesday 10 Januar
[11] => y 2006. This meeting should last no longer than one hour. Than

So the first meeting takes over the second meetings text string,
I need something more like
[10] => le. This meeting will be @ 1000 in CR#1, Tuesday 10 Januar
[11] => CR#1, Tuesday 10 January 2006. This meeting should last no
longer than one hour. Than

Thanks,
James Ratcliff
Falazar@xxxxxxxxx

.



Relevant Pages

  • Re: Development Question: How to tell if SPWeb is a Document WorkSpace?
    ... Microsoft.SharePoint.SPWeb) As String ... Dim subSite As SPWeb ... >> document workspaces, and other sub webs. ... >> that where made with a meeting template. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: A simple metaobject protocol for packages
    ... Christophe Rhodes wrote: ... string for google to find anything myself. ... Meeting: some details are at ...
    (comp.lang.lisp)
  • Syntax Error
    ... I have a form where a user can enter the date so that a list of invoices ... meeting that date will be printed. ... Dim strWhere As String ... However I get a Syntax error in string in expression. ...
    (microsoft.public.access.forms)
  • Re: day of month
    ... The following code works for when it is the day of the week, but I have a problem when I list tomorrows meeting and today's date is the last day of the week - it will not recognise the 1st day of the next moth as being tomorrows date. ... var day=mydate.getDay ... Ensures n is always returned as a string. ...
    (comp.lang.javascript)