pcre_get_named_substring(3) [opensolaris man page]
PCRE_GET_NAMED_SUBSTRING(3) Library Functions Manual PCRE_GET_NAMED_SUBSTRING(3)NAME
PCRE - Perl-compatible regular expressions
SYNOPSIS
#include <pcre.h>
int pcre_get_named_substring(const pcre *code,
const char *subject, int *ovector,
int stringcount, const char *stringname,
const char **stringptr);
DESCRIPTION
This is a convenience function for extracting a captured substring by name. The arguments are:
code Compiled pattern
subject Subject that has been successfully matched
ovector Offset vector that pcre_exec() used
stringcount Value returned by pcre_exec()
stringname Name of the required substring
stringptr Where to put the string pointer
The memory in which the substring is placed is obtained by calling pcre_malloc(). The convenience function pcre_free_substring() can be
used to free it when it is no longer needed. The yield of the function is the length of the extracted substring, PCRE_ERROR_NOMEMORY if
sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
There is a complete description of the PCRE native API in the pcreapi page and a description of the POSIX API in the pcreposix page.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWpcre |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for PCRE is available on http://opensolaris.org.
PCRE_GET_NAMED_SUBSTRING(3)
Check Out this Related Man Page
PCRE_GET_NAMED_SUBSTRING(3) Library Functions Manual PCRE_GET_NAMED_SUBSTRING(3)NAME
PCRE - Perl-compatible regular expressions
SYNOPSIS
#include <pcre.h>
int pcre_get_named_substring(const pcre *code,
const char *subject, int *ovector,
int stringcount, const char *stringname,
const char **stringptr);
int pcre16_get_named_substring(const pcre16 *code,
PCRE_SPTR16 subject, int *ovector,
int stringcount, PCRE_SPTR16 stringname,
PCRE_SPTR16 *stringptr);
DESCRIPTION
This is a convenience function for extracting a captured substring by name. The arguments are:
code Compiled pattern
subject Subject that has been successfully matched
ovector Offset vector that pcre[16]_exec() used
stringcount Value returned by pcre[16]_exec()
stringname Name of the required substring
stringptr Where to put the string pointer
The memory in which the substring is placed is obtained by calling pcre[16]_malloc(). The convenience function pcre[16]_free_substring()
can be used to free it when it is no longer needed. The yield of the function is the length of the extracted substring, PCRE_ERROR_NOMEMORY
if sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
There is a complete description of the PCRE native API in the pcreapi page and a description of the POSIX API in the pcreposix page.
PCRE_GET_NAMED_SUBSTRING(3)
hi all, I'm really newbie on this and I need some help.
how is the best way to extract a strig or substring from a each line in a file.
e.g. I want to print only this ERROR=JUD+the followed numbers from one line like this one, considering the numbers change related to different errors
... (1 Reply)
I have two files:
One is a list of numbers:
1
5
6
7
10
The second is a very long string
abcdefghijklmno......1234567890
I'd like to print a new file with a 5 character substring that starts at each the positions listed in the 1st file:
such as:
abcde (4 Replies)
I will be performing a task on several directories, each containing a large number of files (2500+) that follow a regular naming convention:
YYYY_MM_DD_XX.foo_bar.A.B.some_different_stuff.EXT
What I would like to do is automatically discover the part of the filenames that are common to all... (1 Reply)
hi
i need to name a file with a substring of a another file name.
i.e. if the old filename is abc.txt , the new filename should be abc_1.txt
i should get the substring of the file name and then name the new one
please let me know how to do it (4 Replies)
Hi,
I have looked all over for this. I am attempting to get a the substring of a string using sed since it seemed the best solution for this.
For example my string is: "zzz foo to you and bar123 or foo"
I would like to extract the text between "and" and "or" (it could be anything, but... (2 Replies)
I'm new to shell scripting and am trying to write a small script that pulls a substring out of a file that has a few lines of text in it. The file will eventually have a lot of text, I just put a few lines in it for testing purposes.
Anyway, this is what I have so far...
#!/bin/ksh
... (4 Replies)
I'd like to print a line if a substring is matched in a case insensitive manner
something like do a case insensitive search for ABCD as a substring:
awk '{ if (substr($1,1,4) == "") print $1 }' infile > outfile
I'm not certain how to make the syntax work???
Thanks (4 Replies)
Hi,
Please let me know how to perform the substring operation in kshell.
If i have line like below
238923893282389034893489458945904589045454903490
i would like to retrieve the position 7 to 19, how to do this in kshell? (1 Reply)
I am new to awk and writing a script using awk. I have file containing fixed length records, I wish to extract 2 substring(each substring is padded with zeros on left e.g 000000003623) and add each substring respectively for every record in the file to get total sum of respective substring for all... (5 Replies)
Hi,
I am new to Unix. I am trying to extract a substring from an input string: Ex -
input string: deploy_v11_9_1
i want to extract and store the value v11_9_1 from the input string in a new variable.
I am using following command in my shell script file:
echo "Enter the folder name u... (5 Replies)
I want to merge the lines by matching substring of the first file with first column of the second file.
file1:
S00739A_ACAGTG_L001_R1.fq.gz
S00739A_ACAGTG_L001_R2.fq.gz
S00739B_GCCAAT_L001_R1.fq.gz
S00739B_GCCAAT_L001_R2.fq.gz
S00739D_GTGAAA_L001_R1.fq.gz
S00739D_GTGAAA_L001_R2.fq.gz... (14 Replies)