<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Regular Expressions for GA, Bonus III: Lookahead</title>
	<atom:link href="http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/</link>
	<description>LunaMetrics</description>
	<lastBuildDate>Thu, 11 Mar 2010 00:43:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: DarrenJames</title>
		<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/comment-page-1/#comment-1523</link>
		<dc:creator>DarrenJames</dc:creator>
		<pubDate>Thu, 08 Oct 2009 11:26:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/#comment-1523</guid>
		<description>Now that looknegative lookaheads in GA are no longer available, is there any workarounds for this?</description>
		<content:encoded><![CDATA[<p>Now that looknegative lookaheads in GA are no longer available, is there any workarounds for this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Open SEO</title>
		<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/comment-page-1/#comment-624</link>
		<dc:creator>Open SEO</dc:creator>
		<pubDate>Wed, 03 Jun 2009 08:14:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/#comment-624</guid>
		<description>Nice example very clear.
However, Google Analytics team confirmed that they dropped support for negative lookahead in GA; because of some security risk they say.</description>
		<content:encoded><![CDATA[<p>Nice example very clear.<br />
However, Google Analytics team confirmed that they dropped support for negative lookahead in GA; because of some security risk they say.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Problemi con i funnel di navigazione di Google Analytics</title>
		<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/comment-page-1/#comment-623</link>
		<dc:creator>Problemi con i funnel di navigazione di Google Analytics</dc:creator>
		<pubDate>Thu, 08 Jan 2009 23:09:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/#comment-623</guid>
		<description>[...] regolari avanzate con asserzioni negative che &#8220;guardano avanti&#8221;, proponendo anche un link di approfondimento. In realtà penso che nella maggior parte dei casi si possa ricorrere ad espressioni meno avanzate [...]</description>
		<content:encoded><![CDATA[<div style="">
<p>[...] regolari avanzate con asserzioni negative che &#8220;guardano avanti&#8221;, proponendo anche un link di approfondimento. In realtà penso che nella maggior parte dei casi si possa ricorrere ad espressioni meno avanzate [...]</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Online Marketing Blog &#187; Blog Archive &#187; Funnel Problems in Google Analytics</title>
		<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/comment-page-1/#comment-622</link>
		<dc:creator>Online Marketing Blog &#187; Blog Archive &#187; Funnel Problems in Google Analytics</dc:creator>
		<pubDate>Sun, 10 Aug 2008 07:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/#comment-622</guid>
		<description>[...] can avoid problems with a step matching subsequent steps by using regular expression that have negative lookaheads to exclude the later [...]</description>
		<content:encoded><![CDATA[<div style="">
<p>[...] can avoid problems with a step matching subsequent steps by using regular expression that have negative lookaheads to exclude the later [...]</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robbin</title>
		<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/comment-page-1/#comment-621</link>
		<dc:creator>Robbin</dc:creator>
		<pubDate>Sun, 12 Aug 2007 18:40:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/#comment-621</guid>
		<description>Alan, this was so great that I edited the post  -- I am hoping that everyone else will read your comment, too.

Robbin

ps I really don&#039;t get credit here. Steve gets the credit.</description>
		<content:encoded><![CDATA[<p>Alan, this was so great that I edited the post  &#8212; I am hoping that everyone else will read your comment, too.</p>
<p>Robbin</p>
<p>ps I really don&#8217;t get credit here. Steve gets the credit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/comment-page-1/#comment-619</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Sat, 11 Aug 2007 18:11:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/#comment-619</guid>
		<description>Reporting live from the Paris mÃ©troâ€¦
(specifically: RER Ligne A, between ChÃ¢telet-les-Halles and Auber, for those who like the details)

This is really powerful Robbin. Everytime I think that RegEx has no more secrets for me, you come up with something new on this blog.

My fellow metro commuters (Serge, Jean-Pierre and Jean-FranÃ§ois â€“ just kidding) and myself were just debating about the last example you used: member(?=s)hip, and though it is understood that it will NOT match â€œmembershipâ€, we were wondering what it WOULD match, if anythingâ€¦
Personally, my money was on it matching â€œmemberhipsâ€ (match â€œmemberâ€ â€“ as long as it is followed at some point further down the line by an â€˜sâ€™ â€“ followed by â€œhipâ€). Alas, Iâ€™m wrong again, as is so often the case in these situations. I tested it in the RegEx Coach, and it failed miserably. As the RegEx is written, â€œmemberâ€ needs to be immediately followed by â€œsâ€.

However, I played around with it a bit further and found a way to make these lookaheads function in a â€œanywhere further down the lineâ€ kinda way. If we use a RegEx like the following:

member(?=.*s)hip

then it WILL match â€œmemberhipsâ€ (or rather it will match â€œmemberhipâ€ so long as it is followed further in the string by an â€˜sâ€™).
I really like the fact that the (?=.*s) leapfrogs the following element â€œhipâ€ as it illustrates well what you were saying about it being a mere condition that qualifies â€œmemberâ€ and NOT an element in the string that needs to be taken into account in the sequence.

We could imagine the follwing URIs:
/checkout.php?...6billion_parameters...&amp;finalOutcome=credit_card_visa_ok&amp;step=purchase
/checkout.php?...6billion_parameters...&amp;finalOutcome=mail_cheque_pending&amp;step=purchase
/checkout.php?...6billion_parameters...&amp;finalOutcome=debit_card_mastercard&amp;step=purchase
/checkout.php?...6billion_parameters...&amp;finalOutcome=credit_card_amex&amp;step=purchase
/checkout.php?...6billion_parameters...&amp;finalOutcome=credit_card_error&amp;step=purchase
etc.

In this instance let us imagine wanting to match all /checkout.php URIs with the parameter step=purchase, UNLESS the value of the â€œfinalOutcome=â€ parameter is â€œcredit_card_errorâ€.
We could simply use the following RegEx:

/checkout\.php\?(?!.*finalOutcome=credit_card_error).*&amp;step=purchase

Read this as: match all URIs that contain â€œ/checkout.php?â€ (so long as you canâ€™t find anywhere in the string following â€œfinalOutcome=credit_card_errorâ€), followed by any text, followed by â€œ&amp;step=purchaseâ€

I canâ€™t imagine the number of times I&#039;ve had a need for these conditional lookaheads, but not being aware of their existence, I ended up with a ludicrously verbose and obscene RegEx instead
.Thanks for furthering our knowledge once again :)

Alan</description>
		<content:encoded><![CDATA[<p>Reporting live from the Paris mÃ©troâ€¦<br />
(specifically: RER Ligne A, between ChÃ¢telet-les-Halles and Auber, for those who like the details)</p>
<p>This is really powerful Robbin. Everytime I think that RegEx has no more secrets for me, you come up with something new on this blog.</p>
<p>My fellow metro commuters (Serge, Jean-Pierre and Jean-FranÃ§ois â€“ just kidding) and myself were just debating about the last example you used: member(?=s)hip, and though it is understood that it will NOT match â€œmembershipâ€, we were wondering what it WOULD match, if anythingâ€¦<br />
Personally, my money was on it matching â€œmemberhipsâ€ (match â€œmemberâ€ â€“ as long as it is followed at some point further down the line by an â€˜sâ€™ â€“ followed by â€œhipâ€). Alas, Iâ€™m wrong again, as is so often the case in these situations. I tested it in the RegEx Coach, and it failed miserably. As the RegEx is written, â€œmemberâ€ needs to be immediately followed by â€œsâ€.</p>
<p>However, I played around with it a bit further and found a way to make these lookaheads function in a â€œanywhere further down the lineâ€ kinda way. If we use a RegEx like the following:</p>
<p>member(?=.*s)hip</p>
<p>then it WILL match â€œmemberhipsâ€ (or rather it will match â€œmemberhipâ€ so long as it is followed further in the string by an â€˜sâ€™).<br />
I really like the fact that the (?=.*s) leapfrogs the following element â€œhipâ€ as it illustrates well what you were saying about it being a mere condition that qualifies â€œmemberâ€ and NOT an element in the string that needs to be taken into account in the sequence.</p>
<p>We could imagine the follwing URIs:<br />
/checkout.php?&#8230;6billion_parameters&#8230;&amp;finalOutcome=credit_card_visa_ok&amp;step=purchase<br />
/checkout.php?&#8230;6billion_parameters&#8230;&amp;finalOutcome=mail_cheque_pending&amp;step=purchase<br />
/checkout.php?&#8230;6billion_parameters&#8230;&amp;finalOutcome=debit_card_mastercard&amp;step=purchase<br />
/checkout.php?&#8230;6billion_parameters&#8230;&amp;finalOutcome=credit_card_amex&amp;step=purchase<br />
/checkout.php?&#8230;6billion_parameters&#8230;&amp;finalOutcome=credit_card_error&amp;step=purchase<br />
etc.</p>
<p>In this instance let us imagine wanting to match all /checkout.php URIs with the parameter step=purchase, UNLESS the value of the â€œfinalOutcome=â€ parameter is â€œcredit_card_errorâ€.<br />
We could simply use the following RegEx:</p>
<p>/checkout\.php\?(?!.*finalOutcome=credit_card_error).*&amp;step=purchase</p>
<p>Read this as: match all URIs that contain â€œ/checkout.php?â€ (so long as you canâ€™t find anywhere in the string following â€œfinalOutcome=credit_card_errorâ€), followed by any text, followed by â€œ&amp;step=purchaseâ€</p>
<p>I canâ€™t imagine the number of times I&#8217;ve had a need for these conditional lookaheads, but not being aware of their existence, I ended up with a ludicrously verbose and obscene RegEx instead<br />
.Thanks for furthering our knowledge once again <img src='http://www.lunametrics.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Alan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/comment-page-1/#comment-620</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Sat, 11 Aug 2007 14:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.lunametrics.com/blog/2007/08/08/regular-expressions-for-ga-bonus-iii-lookahead/#comment-620</guid>
		<description>Reporting live from the Paris mÃ©tro...
(specifically: RER Ligne A, between Ch</description>
		<content:encoded><![CDATA[<p>Reporting live from the Paris mÃ©tro&#8230;<br />
(specifically: RER Ligne A, between Ch</p>
]]></content:encoded>
	</item>
</channel>
</rss>
