Regular Expression for - \C\R...

Discussion in 'Perl Misc' started by stratus, Nov 2, 2004.

  1. stratus

    stratus Guest

    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.
     
    stratus, Nov 2, 2004
    #1
    1. Advertising

  2. stratus

    Anno Siegel Guest

    stratus <> wrote in comp.lang.perl.misc:
    > 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
     
    Anno Siegel, Nov 2, 2004
    #2
    1. Advertising

  3. -berlin.de (Anno Siegel) writes:
    > stratus <> wrote in comp.lang.perl.misc:
    > > 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:".


    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.
     
    Arndt Jonasson, Nov 2, 2004
    #3
  4. stratus

    Anno Siegel Guest

    Arndt Jonasson <> wrote in comp.lang.perl.misc:
    >
    > -berlin.de (Anno Siegel) writes:
    > > stratus <> wrote in comp.lang.perl.misc:
    > > > 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:".

    >
    > 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
     
    Anno Siegel, Nov 2, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith-Earl
    Replies:
    1
    Views:
    464
    Mary Chipman
    Jun 15, 2004
  2. VSK
    Replies:
    2
    Views:
    2,338
  3. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    864
    Alan Moore
    Dec 2, 2005
  4. GIMME
    Replies:
    3
    Views:
    12,002
    vforvikash
    Dec 29, 2008
  5. Noman Shapiro
    Replies:
    0
    Views:
    240
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page