Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Simple Text Manipulation

by JavaFan (Canon)
on Feb 05, 2011 at 11:10 UTC ( [id://886384]=note: print w/replies, xml ) Need Help??


in reply to Simple Text Manipulation

s/^(Article\s+[0-9]+\s+\N*\S)/\\subsection*{$1}/gm;

Replies are listed 'Best First'.
Re^2: Simple Text Manipulation
by pseingalt (Initiate) on Feb 05, 2011 at 14:45 UTC

    This is the response I get:

    Missing braces on \N{} at article.pl line 2, within pattern Nested quantifiers in regex; marked by <-- HERE in m/^(Article\s+0-9+\s+* <-- HERE \S)/ at article.pl line 2.

      What the JavaFan means is that  \N (without curly braces) in Perl 5.12+ is an experimental backslash sequence that will match any character but a newline. The negated character class  [^\n] will do the same for pre-5.12 Perl (but I haven't tested JavaFan's actual regex). (See Backslashed sequences (5.12.0), fourth paragraph in the Whitespace subsection, for discussion.)

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-25 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found