RegEx coach

-dhs


Dean H. Saxe, CISSP, CEH
[EMAIL PROTECTED]
"What difference does it make to the dead, the orphans, and the homeless, whether the mad destruction is wrought under the name of totalitarianism or the holy name of liberty and democracy? "
    --Gandhi


On Jun 5, 2007, at 1:28 PM, John Mason wrote:

Is there a good regex testing tool out there. I tend to test straight off my
cf code which is cumbersome at times.

John
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dean H. Saxe
Sent: Tuesday, June 05, 2007 1:15 PM
To: discussion@acfug.org
Subject: Re: [ACFUG Discuss] regex help

FWIW, this is an untested regex from off the top of my head...

-dhs


Dean H. Saxe, CISSP,  CEH
[EMAIL PROTECTED]
"[T]he people can always be brought to the bidding of the leaders.
This is easy. All you have to do is to tell them they are being attacked, and denounce the pacifists for lack of patriotism and exposing the country
to danger. It works the same in every country."
--Hermann Goering, Hitler's Reich-Marshall at the Nuremberg Trials


On Jun 5, 2007, at 1:12 PM, Dean H. Saxe wrote:

Don't need the lookarounds....

Use this regex and save $1 and $3 /(<a.*?"http://([^/]+/)+[^?]+?)
([^=]+=\S+\s+\S&?)/gx

Then use this on $2 to replace the spaces s/\s/+/gx.

Then push $1 and $2 back together to get your whole string.

That's the perl way...

-dhs


Dean H. Saxe, CISSP, CEH
[EMAIL PROTECTED]
"What is objectionable, what is dangerous about extremists is not that
they are extreme, but that they are intolerant."
    -- Robert F. Kennedy, 1964


On Jun 5, 2007, at 12:58 PM, Steven Ross wrote:

I was actually just looking for a regex solution to parsing up many
lines of text, some of which contain urls. And if those url's have a
space on the query string to replace those spaces on the query string
with the + character.

I could use CF but, was trying to just get the regex. Possbly using a
lookahead or lookbehind assertion.

-Steven

On 6/5/07, Ajas Mohammed <[EMAIL PROTECTED]> wrote:
do you plan to save the complete url in a variable or just search
keyword in a variable?  For example varUrl = <a
href="http://blah.com?
search=Some
Lingering Suspicion" target="_blank">"A Lingering Suspicion"</a> or
varUrl = "Some Lingering Suspicion"

Please clarify.

Ajas.


On 6/5/07, Steven Ross < [EMAIL PROTECTED]> wrote:
in this string:

<p><b>15) <a href=" http://blah.com?search=Some Lingering
Suspicion"
target="_blank">"A Lingering Suspicion"</a></b></p>

i want to search for the spaces inside:

?search=

and replace those spaces with + so it should end up looking
like this:

?search=Some+Lingering+Suspicion

Can this be done?

thanks,

Steven



--
Steven Ross
web application & interface developer http://www.zerium.com
[mobile] 404-488-4364 [fax] 267-482-4364



-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists Archive @
http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com

-------------------------------------------------------------







--
<Ajas Mohammed />
http://ajashadi.blogspot.com
No matter what, find a way. Because thats what winners do.
-------------------------------------------------------------
Annual Sponsor - Figleaf Software

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists Archive @
http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------


--
Steven Ross
web application & interface developer
http://www.zerium.com
[mobile] 404-488-4364
[fax] 267-482-4364


-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ http://
www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------






-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @http://
www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------






-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------





-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------






-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to