View Single Post
Old 09-10-2018, 08:47 PM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by franknight View Post
Thank you for your quick response. I'm sorry to be such a noob but I just don't understand. It seems to me most all first lines would be less than 200 chars so I would have matched most comment fields. But it didn't - It matched about 3% of them and didn't match some with 20 chars total. Could you feed my feeble mind with a little more info. Many thanks. frank
The problem is that your regex is matching against each line in the comment. That is, it is matching against lines of comment that end in a new-line character. If the comment has a single line with less than 200 characters in it, then it will be matched. And from what I have seen, that will be fairly common.

Kovid's suggestion is to change the regex to :

Code:
(?s)^.{0,200}$
But, I'm not sure if that will do exactly what you want. I can't test it at the moment.
davidfor is offline   Reply With Quote