Regular Expression for - \C\R...

S

stratus

I want to know what is the meaning of \C and \R.

for example, if(/^\s*(\C\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i)
if(/^\s*(\R\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i){


I cannot find this in the document.
 
A

Anno Siegel

stratus said:
I want to know what is the meaning of \C and \R.

for example, if(/^\s*(\C\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i)
if(/^\s*(\R\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i){


I cannot find this in the document.

What document? Have you looked in perlre? Search for
"In addition, Perl defines the following:".

Anno
 
A

Arndt Jonasson

What document? Have you looked in perlre? Search for
"In addition, Perl defines the following:".

Maybe stratus uses an older version of perl. \S seems to be fairly recent.

For \C, it says:
\C Match a single C char (octet) even under Unicode.
NOTE: breaks up characters into their UTF-8 bytes,
so you may end up with malformed pieces of UTF-8.
Unsupported in lookbehind.

But I can't find \R in the doc for perl 5.8 either.
 
A

Anno Siegel

Arndt Jonasson said:
Maybe stratus uses an older version of perl. \S seems to be fairly recent.

I suppose you mean "\C". "\S" is ancient.
For \C, it says:
\C Match a single C char (octet) even under Unicode.
NOTE: breaks up characters into their UTF-8 bytes,
so you may end up with malformed pieces of UTF-8.
Unsupported in lookbehind.

But I can't find \R in the doc for perl 5.8 either.

"\R" (which I overlooked the first time) doesn't seem to have a
function in a regex. under current Perl, perl -le 'print qr/\R/'
simply shows "(?-xism:R)".

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top