In a message dated 12/12/2005 6:38:31 A.M. Eastern Standard Time, [EMAIL PROTECTED] writes:
 
> I agree, and I am also self-taught and certainly not an expert at
> regexps.  I would like to get a single regexp, if possible, as a matter
if by ``single regexp'' you mean a one-liner, i would strongly urge investigating the /x regex switch and the embedded commenting feature of recent versions (like, since about perl 5.0 -- i think) of the perl regex engine.   likewise, the qr// regex object definer (since version 5.5, i think) so that regexes can more easily be factored into digestible pieces.   using these and other, similar techniques may help to save somebody's sanity -- and that someone may be you!  
 
> of challenge and learning.  As I mentioned in my first post, the regexp
> I came up with, after modifying the CSV-split example in the Perl
> Cookbook, worked beautifully -- all except for trailing whitespace of a
> field (spaces before the delimiter).  It would have been even easier for
> me to just $_ =~ /\s*$//; each field at the end, but I want to learn
> what I missed, and perhaps improve my work.
 
btw -- i agree with bill luebkert that the specification you gave was NOT complete.   writing such a specification is not easy -- especially for someone familiar with the problem being addressed: it's like having someone who is wrote an application write the documentation for that application.  
hth -- bill walters  
 
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to