Autor: Sandhya Sriraj Fecha: A: pcre-dev Asunto: Re: [pcre-dev] Match for the first 100 charaters of a string
Thanks for your reply.
This will solve my problem.
On Tue, Oct 9, 2012 at 9:08 PM, Philip Hazel <ph10@???> wrote:
> On Tue, 9 Oct 2012, Sandhya Sriraj wrote:
>
> > Hi,
> > I want to display first 1000 characters of a string (literals are
> replaced
> > by special symbol). I am using pcre library to replace the literal. After
> > replacing every literal I am checking for the length of the string and if
> > it is > 1000 then stop matching and display the string.
> >
> > My problem is, Suppose I am sending a string with length 1GB, and if
> there
> > is no literal in that string, pcre will check for the entire string. I
> want
> > to check the match for first 1000 charaters. Is there any way to do this?
>
> The matching function pcre_exec() takes the string as a pointer and a
> length. Just set the length to 1000 if you want to search only the first
> 1000 characters.
>
> Philip
>
> --
> Philip Hazel
>