• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Perl help

NeoMadHatter

Platinum Member
i'm wondering if it's possible to get lines like this separated:

class Ab {

or:

class Ab{

into:

class
Ab
{

and like:

int f(int x,char z,double *x);

into:

int
f
int
x
char
z
double *
x

all i know so far is the matching part:
ie. m/class/;

thanks.
 
if they are all space separated, you can simply
s/\s+/\n/g;

if they are mixed space and symbols, you'll need extra work:
s/(\W)/\n$1\n/g;

(or something like that ...)

use susbsitution s/// instead of matching m// since you want to substitute the spaces (and others) into newlines
 
Back
Top