in reply to Re: Help composing Regex for matching only Titlecase words
in thread Help composing Regex for matching only Titlecase words

You anchor your words on just one side. Which means that if you have a sentence like "The USA is a UN member", you return "The U U". I did not get the impression that is what the OP wants.
  • Comment on Re^2: Help composing Regex for matching only Titlecase words

Replies are listed 'Best First'.
Re^3: Help composing Regex for matching only Titlecase words
by kennethk (Abbot) on Mar 03, 2011 at 21:54 UTC
    The OP does not include USA or UN as example text. Mine also gives results that are likely undesirable for character sequences that contain numbers or punctuation. Yours is likely no better on that front, though you did provide a disclaimer. Development of any regular expression depends strongly on what you are going to feed it - I think mine has the advantage of outputting more junk that yours would, making its weaknesses more obvious once the OP started putting it into practice.
      The OP does not include USA or UN as example text.
      Why do you think the OP had $data =~ s/[A-Z]{2,100}//; in the code he tried?