This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

regexp problem

Old posts that have not been replied to for several years.
Locked
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

regexp problem

Post by ProXy »

Hi all,

I have a var that contains the content of a website, and ich want to pick out a specific part of this conent and save it to a new var.

Code: Select all

		regexp {^.*Stream Title: </font></td><td><font class=default><b>(.*)</b>.*} $streamdata streamdata streamname

This not only saves the String but also the content below </b>. Does anyone know what`s the error?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

ermm...
I think it is regsub you want to use.. not regexp

regsub - Perform substitutions based on regular expression pattern matching
SYNTAX: regsub ?switches? exp string subSpec ?varName?
Elen sila lúmenn' omentielvo
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Post by ProXy »

I want to catch all between the bold tags and save this to a new var. I have a second line in my TCL, but this line works:

Code: Select all

regexp {^.*Stream Status: </font></td><td><font class=default><b>Stream is up at (.*) kbps with <B>(.*) of (.*) listeners \((.*) unique\).*} $streamdata streamdata streamkbps streamlisteners streammaxlisteners streamuniquelisteners
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Use the scan command rather than regexp.
Locked