jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Strullato" <marco.strull...@gmail.com>
Subject complex regular expression
Date Fri, 05 Sep 2008 08:15:19 GMT
Hi all, I have to create a quite complex regex to extract a row index.
This is the html:


                                                     <td
class="tCellType_text">

                                                         <span
id="content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-1-.row.rowObject.processDefinitionName">SubApprovalConsumerWithSupervisor</span>


                                                     </td>

                                                     <td
class="tCellType_text">

                                                         <span
id="content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-1-.row.rowObject.activityDefinitionName">Application
Summary</span>

                                                     </td>

                                                     <td
class="tCellType_select1">

                                                         <span
id="content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-1-.row.rowObject.status"
title="Active">Active</span>

                                                     </td>

                                                     <td
class="tCellType_select1">


                                                         <a href=""
onclick="submitEvent(document.forms['UX_FORM'],
'content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-1-.row.locking');
return false;">

                                                             <img
src="/Lending_Web/file/(9852393708D7B53F)/com/finantix/stdlib/lang/lim/xsl/ux/util/img/LockOpened.gif"
alt="Locking"></img>

                                                         </a>

                                                     </td>


As you can see there are spaces at the beginning of the line

I have to extract the row index (in this html is 1) where the
conditions are Active and Opened and a variable 9852393708D7B53F.
Maybe an example could be useful to understand:


                                                     <td
class="tCellType_text">\n

                                                         <span
id="content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-(\d+)-.row.rowObject.processDefinitionName">SubApprovalConsumerWithSupervisor</span>\n


                                                     </td>\n

                                                     <td
class="tCellType_text">\n

                                                         <span
id="content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-(\d+)-.row.rowObject.activityDefinitionName">Application
Summary</span>\n

                                                     </td>\n

                                                     <td
class="tCellType_select1">\n

                                                         <span
id="content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-(\d+)-.row.rowObject.status"
title="Active">Active</span>\n

                                                     </td>\n

                                                     <td
class="tCellType_select1">\n


                                                         <a href=""
onclick="submitEvent(document.forms['UX_FORM'],
'content.activitySection.runningActivities.activities.ShowTabs.tabItem.viewsTabpane.ShowTabs.tabItem.content.container.instancesTable.currentRows-(\d+)-.row.locking');
return false;">\n

                                                             <img
src="/Lending_Web/file/((\w+))/com/finantix/stdlib/lang/lim/xsl/ux/util/img/LockOpened.gif"
alt="Locking"></img>\n

                                                         </a>\n

                                                     </td>\n


I also add the \n to the newlines

How do you suggest me to write this regex? I tried different ways to
run the regex but unfortunately anyone give me expected results. What
I expect is to have many matches of the the row index, ad I'll select
the first.

Regards,

Marco Strullato

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message