Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: making a regex work with Unicode

by vr (Curate)
on Feb 26, 2017 at 10:15 UTC ( [id://1182874]=note: print w/replies, xml ) Need Help??


in reply to making a regex work with Unicode

Sorry, maybe it's nitpicking or not, but using /b assertion just won't work for the task as stated:

...article... plain-text ...each paragraph takes up one "line"

Punctuation may be torn from preceding words, including (always) at the end of paragraph.

C:\>perl -e "@a=(qq(This produced output where most lines, alas, were +not wrapped.\n\n))x3; for (@a) { s/(.{0,37})\b/$1\n/g; print }" This produced output where most lines , alas, were not wrapped . This produced output where most lines , alas, were not wrapped . This produced output where most lines , alas, were not wrapped .

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1182874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found