preg_split problem



Hi, all. I have a poroblem, and I'd really appreciate if someone helped me to solve it.

The problem is, I want to take the first two sentences of a string. To do that i need to split them whenever a dot occurs, and the join the first two array occurences in a new string but I have a problem beacuse the dot in the Croatian languages is not always used a sentence delimiter, but is often used in conjuction with numbers and acronyms. So I wanted to use a regular expression to split a string on every dot ocurence but not when a dot is precedeed by a number or a 'd' or a 'o'.
This is my best shot at it:

$string='Glavna skupština Društva će se održati 27.12.2007. (četvrtak) u 11 sati u prostorijama Doma hrvatske voj­ske u Lori u Splitu.Atlas turistička agencija d.d. stekla je 22. i 23. studenog 2007. godine 2800 vlastitih dionica.';
$uvod=preg_split('/((d\.o\.o\.)!|(d\.d\.)!|[0-9]!)|\./', $string);
print_r($uvod);

But it doesn't work right. If someone knows how to slove this problem. Any help will be really appreciated.

TIA

Nikola
.



Relevant Pages

  • Re: Code to check if a valid e-mail address was entered
    ... Function Valid_Email(E_Address As String) As Boolean ... ' Note that the part after the @ sign must contain at least one dot, ... ' at least one other character following it, ... Dim TString As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Numeric valication
    ... it accepts any string EITHER ... followed by a digit AND followed by a dot which might not be ... So to further my knowledge of regexps, I will study your examples further. ...
    (microsoft.public.scripting.jscript)
  • Re: Simplified TimeZone
    ... reflection shows that the TimeZone ... String abbr = tz.getDisplayName; ... private static void printTzParams { ... home dot woh dot rr dot com slash jbmatthews ...
    (comp.lang.java.programmer)
  • Re: preg_split problem
    ... To do that i need to split them whenever a dot occurs, and the join the first two array occurences in a new string but I have a problem beacuse the dot in the Croatian languages is not always used a sentence delimiter, but is often used in conjuction with numbers and acronyms. ... Formulating the exact requirements before writing the regex is more then half the work. ...
    (comp.lang.php)