Question:

Which regular expression should I use? (PHP)

by  |  earlier

0 LIKES UnLike

I'm getting a page copy pasted as input and I'm trying to capture the following part to get specific information:

"Agresor Kadbar de aldea 02.Bender"

This should come between lots of text like this:

Asunto: 02.Bender ataca a Villa Esperanza

Enviado: el d?a 10.08.08 a las 20:51:24 horas

Agresor Kadbar de aldea 02.Bender

Tropas 0 0 34 0 0 0 0 0 0 0

P?rdidas 0 0 0 0 0 0 0 0 0 0

Bot?n 477 535 380 75

I'd like to create a REGEXP to use with preg_match() in PHP so that I can get that string and then strip it to get the important pieces: Kadbar and 02.Bender.

So far I've tried with /Agresor(.)/ but that gives me (AFAIK) 2 rows in the $matches array, one contaning "A" and one blank "".

Any ideas?

 Tags:

   Report

1 ANSWERS


  1. /Agresor/

    should match the whole line

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.