Title: Re: Learning GREP - need help with one example
Here's my (hopefully) tweaked and corrected version:

FIND:
(https*://\S+/)(\S+?[^[:punct:]])(/?)(?:(?=[> \t])|(?=[[:punct:]]|$))

CHANGE TO:
<a href="">

Changes (in bold) include adding [^[:punct:]] at the end of the second capture, so that following punctuation is handled as intended. And I removed the \r, which should have been \n, even if it were there, from (?=[> \t]) , since the $ hnadles the instance, anyway.


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

On 3/5/13 at 1:50 PM -0800, Rick Gordon wrote in a message entitled
"Re: Learning GREP - need help with one example":

That turns your original example (http://www.mysite.com/section/subsection/Z3245678a34/) into:

<a href="" href="" >">Z3245678a34</a">a</a>>

& is a capture for the whole original _expression_ -- not what you want.

I also see that my own suggestion was flawed. The [[:punct:]] part is not working right (on mine or yours) and needs reconsideration, but I'm in the middle of other stuff right now.

Also, the \r should be \n for BBEdit, but actually is not necessary at all, because the $ part takes care of it anyway.


-- 
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:   http://www.shelterpub.com



--
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem,
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
 
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to