1 Copyright (C) 2016 and later: Unicode, Inc. and others.
2 License & terms of use: http://www.unicode.org/copyright.html#License
4 Copyright (c) 2002-2005, International Business Machines Corporation and others. All Rights Reserved.
5 ugrep: a sample program demonstrating the use of ICU regular expression API.
7 usage: ugrep [options] pattern [file ...]
9 --help Output a brief help message
10 -n, --line-number Prefix each line of output with the line number within its input file.
11 -V, --version Output the program version number
14 The program searches for the specified regular expression in each of the
15 specified files, and outputs each matching line.
17 Input files are in the system default (locale dependent) encoding, unless they
18 begin with a BOM, in which case they are assumed to be in the UTF encoding
19 specified by the BOM. Program output is always in the system's default
24 ./ugrep.c source code for the sample
25 ./ugrep.sln Windows MSVC workspace. Double-click this to get started.
26 ./ugrep.vcproj Windows MSVC project file.
27 ./Makefile Makefile for Unixes. Needs gmake.
30 To Build ugrep on Windows
31 1. Install and build ICU
32 2. In MSVC, open the workspace file icu\samples\ugrep\ugrep.sln
33 3. Choose a Debug or Release build.
37 1. Start a command shell window
38 2. Add ICU's bin directory to the path, e.g.
39 set PATH=c:\icu\bin;%PATH%
40 (Use the path to where ever ICU is on your system.)
41 3. cd into the ugrep directory, e.g.
42 cd c:\icu\source\samples\ugrep\debug
48 1. Build ICU. Specify an ICU install directory when running configure,
49 using the --prefix option. The steps to build ICU will look something
51 cd <icu directory>/source
52 runConfigureICU <platform-name> --prefix <icu install directory> [other options]
59 Put the install directory containing icu-config on the $PATH.
60 This will generally be <icu install directory>/bin
61 cd <icu directory>/source/samples/ugrep
65 cd <icu directory>/source/samples/ugrep
67 export LD_LIBRARY_PATH=<icu install directory>/lib:.:$LD_LIBRARY_PATH
71 Note: The name of the LD_LIBRARY_PATH variable is different on some systems.
72 If in doubt, run the sample using "gmake check", and note the name of
73 the variable that is used there. LD_LIBRARY_PATH is the correct name
74 for Linux and Solaris.