libraries/spcre/grep/Grep.cif
author Tom Sutcliffe <thomas.sutcliffe@accenture.com>
Tue, 07 Dec 2010 17:29:09 +0000
changeset 90 ceac7084e2e5
parent 79 dae66483be2b
permissions -rw-r--r--
Implemented RObjectIx-based memoryaccess APIs. Upshot is that objinfo now works again on platforms that define FSHELL_NO_DOBJECTIX_SUPPORT.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     1
# Grep.cif
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     2
# 
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     3
# Copyright (c) 2009 - 2010 Accenture. All rights reserved.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     5
# under the terms of the "Eclipse Public License v1.0"
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     8
# 
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
     9
# Initial Contributors:
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    10
# Accenture - Initial contribution
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    11
#
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    12
==name grep
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    13
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    14
==short-description
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    15
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    16
Unix-style grep with full Regular Expression support.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    17
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    18
==argument string pattern
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    19
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    20
The pattern to be matched. To escape Regex special characters use '\'.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    21
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    22
==option bool i ignore-case
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    23
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    24
Ignore case distinctions.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    25
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    26
==option bool v invert-match
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    27
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    28
Print lines that do B<not> match.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    29
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    30
==option bool c count
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    31
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    32
Don't print the lines that match, just count them and print the total at the end. If used with C<--invert-match>, counts the number of non-matching lines.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    33
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    34
==option bool u unicode
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    35
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    36
Run the search in unicode (UTF-8) mode rather than assuming ASCII. Possibly slower.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    37
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    38
==long-description
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    39
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    40
Prints to C<stdout> any lines of C<stdin> that match a particular pattern. Uses the PCRE library.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    41
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    42
==see-also
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    43
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    44
L<match|match>
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    45
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    46
==copyright
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    47
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    48
The grep command itself is copyright (c) 2009 - 2010 Accenture. All rights reserved.
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    49
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    50
The copyright notice for the PCRE library follows:
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    51
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    52
               Copyright (c) 1997-2008 University of Cambridge
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    53
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    54
    -----------------------------------------------------------------------------
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    55
    Redistribution and use in source and binary forms, with or without
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    56
    modification, are permitted provided that the following conditions are met:
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    57
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    58
        * Redistributions of source code must retain the above copyright notice,
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    59
          this list of conditions and the following disclaimer.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    60
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    61
        * Redistributions in binary form must reproduce the above copyright
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    62
          notice, this list of conditions and the following disclaimer in the
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    63
          documentation and/or other materials provided with the distribution.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    64
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    65
        * Neither the name of the University of Cambridge nor the names of its
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    66
          contributors may be used to endorse or promote products derived from
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    67
          this software without specific prior written permission.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    68
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    69
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    70
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    71
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    72
    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    73
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    74
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    75
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    76
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    77
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    78
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    79
    POSSIBILITY OF SUCH DAMAGE.
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    80
    -----------------------------------------------------------------------------
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    81
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    82
The copyright notice for the C++ wrappers to PCRE library follows:
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    83
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    84
    Copyright (c) 2005 - 2006, Google Inc.
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    85
    All rights reserved.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    86
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    87
    Redistribution and use in source and binary forms, with or without
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    88
    modification, are permitted provided that the following conditions are
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    89
    met:
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
    90
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    91
        * Redistributions of source code must retain the above copyright
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    92
    notice, this list of conditions and the following disclaimer.
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    93
        * Redistributions in binary form must reproduce the above
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    94
    copyright notice, this list of conditions and the following disclaimer
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    95
    in the documentation and/or other materials provided with the
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    96
    distribution.
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    97
        * Neither the name of Google Inc. nor the names of its
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    98
    contributors may be used to endorse or promote products derived from
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
    99
    this software without specific prior written permission.
0
7f656887cf89 First submission to Symbian Foundation staging server.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents:
diff changeset
   100
79
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   101
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   102
    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   103
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   104
    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   105
    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   106
    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   107
    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   108
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   109
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   110
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dae66483be2b minor build tweaks.
Tom Sutcliffe <thomas.sutcliffe@accenture.com>
parents: 0
diff changeset
   111
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.