On Mon, Jun 24, 2002 at 04:55:07PM -0400, Pedro A Reche wrote:

> Hi all,
> I would like  to match a string variable in a longer string  retreiveing
> the match plus 5 extra characters at each side of the
> match.
> This what I mean:
> 
> $var = 'something';
> $line = 'SDFGHAsomethingWDFTsft';
> 
> and, I would like  to get in a new variable the string
> 'DFGHAsomethingWDFTs'.
> Any help in doing this will be very appreciated.

What, in particular, is causing you difficulties?

Do you understand about regular expressions?  Do you not know how to
capture a match, how to interpolate a variable in a regular expression,
how to specify any character, how to specify five of them?

Give us a clue on how to help you.  Post the code you have and tell us
what the problems are.

Of course I could just post some working code.  Maybe someone will.  But
working through the problem will probably be more useful to all
concerned and those who are watching.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to