Rex Exp

Post Reply
source1Tamer
Posts: 91
Joined: Tue Nov 13, 2001 3:49 pm

Rex Exp

Post by source1Tamer »

I want to rex the following string out of a paragraph:

[ss33] [Mess. Privato] [Home Page] [Cerca Mess.] [Aggiungi Amico] [Modifica Mess.] [Quota e Rispondi]

I coudn't get it all working, I got only the first part "[ss333]" but I coudn't get the rest of the string by using:

<rex ">>=\[=\alnum*\]+" $stringValue>

how could I repeat the whole rex for the rest of the string or is there any other way to do it.....
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Rex Exp

Post by John »

$ret should have contained all occurrences in separate elements, so

<loop $ret>
$ret
</loop>

would have shown them. To concatenate them again you
could use <sum %s '' $ret>
John Turnbull
Thunderstone Software
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Rex Exp

Post by mark »

All the other items also have space in them and some have "." not just alnum. Use a set with all the required characters. And your ">>=" should be just ">>".
source1Tamer
Posts: 91
Joined: Tue Nov 13, 2001 3:49 pm

Rex Exp

Post by source1Tamer »

I got it working by using
">>=\n*\space*\[=\print+\n+"
as I would like it to match only the first line of the paragraph.

thx.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Rex Exp

Post by mark »

Oh, an entirely different set of requirements...

\n*\space* can be simplified to \space* since \n is included in \space.

Depending on requirements I might change \print to [^\n] in case there happens to be some non-printables and I wanted the whole line.

>>=\space*\[=[^\n]+\n+
Post Reply