CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [lex] matching phrases, something weird happens: Edit Log



roolic
User

Apr 16, 2010, 10:47 PM


Views: 4293
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

Code
if( $test =~ /(^.{29}[^\s\'\"\(\)\.\,\;\:\?\!\n\r]+)/){ ... }



(This post was edited by roolic on Apr 16, 2010, 10:48 PM)


Edit Log:
Post edited by roolic (User) on Apr 16, 2010, 10:48 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives