| 3 |
<title>pcresample specification</title> |
<title>pcresample specification</title> |
| 4 |
</head> |
</head> |
| 5 |
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB"> |
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB"> |
| 6 |
This HTML document has been generated automatically from the original man page. |
<h1>pcresample man page</h1> |
| 7 |
If there is any nonsense in it, please consult the man page, in case the |
<p> |
| 8 |
conversion went wrong.<br> |
Return to the <a href="index.html">PCRE index page</a>. |
| 9 |
<ul> |
</p> |
| 10 |
<li><a name="TOC1" href="#SEC1">PCRE SAMPLE PROGRAM</a> |
<p> |
| 11 |
</ul> |
This page is part of the PCRE HTML documentation. It was generated automatically |
| 12 |
<br><a name="SEC1" href="#TOC1">PCRE SAMPLE PROGRAM</a><br> |
from the original man page. If there is any nonsense in it, please consult the |
| 13 |
|
man page, in case the conversion went wrong. |
| 14 |
|
<br> |
| 15 |
|
<br><b> |
| 16 |
|
PCRE SAMPLE PROGRAM |
| 17 |
|
</b><br> |
| 18 |
<P> |
<P> |
| 19 |
A simple, complete demonstration program, to get you started with using PCRE, |
A simple, complete demonstration program, to get you started with using PCRE, |
| 20 |
is supplied in the file <i>pcredemo.c</i> in the PCRE distribution. |
is supplied in the file <i>pcredemo.c</i> in the PCRE distribution. |
| 33 |
an empty string. Comments in the code explain what is going on. |
an empty string. Comments in the code explain what is going on. |
| 34 |
</P> |
</P> |
| 35 |
<P> |
<P> |
| 36 |
On a Unix system that has PCRE installed in <i>/usr/local</i>, you can compile |
If PCRE is installed in the standard include and library directories for your |
| 37 |
the demonstration program using a command like this: |
system, you should be able to compile the demonstration program using this |
| 38 |
</P> |
command: |
|
<P> |
|
| 39 |
<pre> |
<pre> |
| 40 |
gcc -o pcredemo pcredemo.c -I/usr/local/include \ |
gcc -o pcredemo pcredemo.c -lpcre |
| 41 |
-L/usr/local/lib -lpcre |
</pre> |
| 42 |
</PRE> |
If PCRE is installed elsewhere, you may need to add additional options to the |
| 43 |
</P> |
command line. For example, on a Unix-like system that has PCRE installed in |
| 44 |
<P> |
<i>/usr/local</i>, you can compile the demonstration program using a command |
| 45 |
Then you can run simple tests like this: |
like this: |
| 46 |
</P> |
<pre> |
| 47 |
<P> |
gcc -o pcredemo -I/usr/local/include pcredemo.c -L/usr/local/lib -lpcre |
| 48 |
|
</pre> |
| 49 |
|
Once you have compiled the demonstration program, you can run simple tests like |
| 50 |
|
this: |
| 51 |
<pre> |
<pre> |
| 52 |
./pcredemo 'cat|dog' 'the cat sat on the mat' |
./pcredemo 'cat|dog' 'the cat sat on the mat' |
| 53 |
./pcredemo -g 'cat|dog' 'the dog sat on the cat' |
./pcredemo -g 'cat|dog' 'the dog sat on the cat' |
| 54 |
</PRE> |
</pre> |
|
</P> |
|
|
<P> |
|
| 55 |
Note that there is a much more comprehensive test program, called |
Note that there is a much more comprehensive test program, called |
| 56 |
<b>pcretest</b>, which supports many more facilities for testing regular |
<a href="pcretest.html"><b>pcretest</b>,</a> |
| 57 |
expressions and the PCRE library. The <b>pcredemo</b> program is provided as a |
which supports many more facilities for testing regular expressions and the |
| 58 |
simple coding example. |
PCRE library. The <b>pcredemo</b> program is provided as a simple coding |
| 59 |
</P> |
example. |
|
<P> |
|
|
On some operating systems (e.g. Solaris) you may get an error like this when |
|
|
you try to run <b>pcredemo</b>: |
|
| 60 |
</P> |
</P> |
| 61 |
<P> |
<P> |
| 62 |
|
On some operating systems (e.g. Solaris), when PCRE is not installed in the |
| 63 |
|
standard library directory, you may get an error like this when you try to run |
| 64 |
|
<b>pcredemo</b>: |
| 65 |
<pre> |
<pre> |
| 66 |
ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory |
ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory |
| 67 |
</PRE> |
</pre> |
|
</P> |
|
|
<P> |
|
| 68 |
This is caused by the way shared library support works on those systems. You |
This is caused by the way shared library support works on those systems. You |
| 69 |
need to add |
need to add |
|
</P> |
|
|
<P> |
|
| 70 |
<pre> |
<pre> |
| 71 |
-R/usr/local/lib |
-R/usr/local/lib |
| 72 |
</PRE> |
</pre> |
| 73 |
</P> |
(for example) to the compile command to get round this problem. |
|
<P> |
|
|
to the compile command to get round this problem. |
|
| 74 |
</P> |
</P> |
| 75 |
<P> |
<P> |
| 76 |
Last updated: 28 January 2003 |
Last updated: 09 September 2004 |
| 77 |
<br> |
<br> |
| 78 |
Copyright © 1997-2003 University of Cambridge. |
Copyright © 1997-2004 University of Cambridge. |
| 79 |
|
<p> |
| 80 |
|
Return to the <a href="index.html">PCRE index page</a>. |
| 81 |
|
</p> |