
roolic
User
Apr 16, 2010, 10:47 PM
Views: 2965
|
|
Re: [lex] matching phrases, something weird happens
|
|
|
your regex is not clear because the .{N,} do not set the upper limit to substring. it's better to use the exclude condition [^] to define where the string should be cut. then the condition "first 29 characters plus any symbol excluding space, comma, endlines etc" will be look like if( $test =~ /(^.{29}[^\s\'\"\(\)\.\,\;\:\?\!\n\r]+)/){ ... }
(This post was edited by roolic on Apr 16, 2010, 10:48 PM)
|