Hi beginners@perl.org,

hello, very common problem is delimite some strings at certain words,
lets say:
$string = "this is some small test";

Now, we define, the longest $string2 could be 10 characters, and
$string we could delimite only on spaces and optionally punctation
(not on characters).

I'm using:
my ($string2) = $string =~ /^(.{0,10})(?:[\W]|$)/;

Is anyone using something else ?

--

 --. ,--  ,-     ICQ: 7552083      \|||/    `//EB: www.2ge.us
,--' |  - |--    IRC: [2ge]        (. .)    ,\\SN: 2ge!2ge_us
`====+==+=+===~  ~=============-o00-(_)-00o-================~
Quarks -- The CHEERS of the 24th century, and beyond...
 




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to