Re: Help With Grep Pattern

2017-03-05 Thread Dave
If you install the PCRE libraries you get tons of documentation in HTML and 
manpage format. It also includes some useful demos and utilities. Of course 
you can also link to them when you build gnu grep, sed and other programs 
with PCRE dependencies.
http://www.pcre.org

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-03-04 Thread Ole Kristian Ek Hornnes
Thank you - That one was a good one. Herby bookmarked for later use. 
- Ole Kristian Ek Hornnes

lørdag 4. mars 2017 05.45.38 UTC+1 skrev Steve Piercy følgende:
>
> Another nice online tool with more features, including an 
> explanation and highlighting of regex syntax, a larger library 
> of regexes, and an IRC channel is this one: 
> https://regex101.com/ 
>
> --steve 
>
>
> On 3/4/17 at 11:39 AM, wordwe...@gmail.com  (Bill Kochman) 
> pronounced: 
>
> >Hello Ole Kristian, 
> > 
> >Thank you so much for the link. That Regex Pal tool is indeed 
> >very helpful to me. 
> > 
> >Kind regards, 
> > 
> >Bill K. 
> > 
> > 
> >>On Mar 4, 2017, at 7:08 AM, Ole Kristian Ek Hornnes  > 
> >wrote: 
> >> 
> >>Hello, 
> >>I am often using http://www.regexpal.com to test out reg-ex patterns. 
> This 
> >also contains a handy list of codes, and gives you the 
> >opportunity to test the reg-ex 
> >>before using it in BBEdit Search/Replace or Multi File Search/Replace. 
> > 
>
>  
> Steve Piercy, Soquel, CA 
>
>

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-03-03 Thread Bill Kochman
Thank you Steve. That tool is also very helpful.

Even though I have read the BBEdit manual’s section regarding grep patterns a 
number of times over the years, regex and grep patterns has remained a “mystery 
language” to me, never fully understanding how to put the pieces of the puzzle 
together right in order to find and replace what I need.

The two tools that you and Ole have pointed me to will definitely help to 
expand my understanding regarding how to use grep patterns.

Thanks to you both again.

Kind regards,

Bill K.


> On Mar 4, 2017, at 2:45 PM, Steve Piercy  wrote:
> 
> Another nice online tool with more features, including an explanation and 
> highlighting of regex syntax, a larger library of regexes, and an IRC channel 
> is this one:
> https://regex101.com/
> 
> --steve

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-03-03 Thread Steve Piercy
Another nice online tool with more features, including an 
explanation and highlighting of regex syntax, a larger library 
of regexes, and an IRC channel is this one:

https://regex101.com/

--steve


On 3/4/17 at 11:39 AM, wordweaver...@gmail.com (Bill Kochman) pronounced:


Hello Ole Kristian,

Thank you so much for the link. That Regex Pal tool is indeed 
very helpful to me.


Kind regards,

Bill K.



On Mar 4, 2017, at 7:08 AM, Ole Kristian Ek Hornnes 

wrote:


Hello,
I am often using http://www.regexpal.com to test out reg-ex patterns. This
also contains a handy list of codes, and gives you the 
opportunity to test the reg-ex

before using it in BBEdit Search/Replace or Multi File Search/Replace.





Steve Piercy, Soquel, CA

--
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-03-03 Thread Bill Kochman
Hello Ole Kristian,

Thank you so much for the link. That Regex Pal tool is indeed very helpful to 
me.

Kind regards,

Bill K.


> On Mar 4, 2017, at 7:08 AM, Ole Kristian Ek Hornnes  
> wrote:
> 
> Hello, 
> 
> I am often using http://www.regexpal.com to test out reg-ex patterns. This 
> also contains a handy list of codes, and gives you the opportunity to test 
> the reg-ex 
> before using it in BBEdit Search/Replace or Multi File Search/Replace.

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-03-03 Thread Ole Kristian Ek Hornnes
Hello, 

I am often using http://www.regexpal.com to test out reg-ex patterns. This 
also contains a handy list of codes, and gives you the opportunity to test 
the reg-ex 
before using it in BBEdit Search/Replace or Multi File Search/Replace.




Hovering over the parts of the reg-ex explains each individual part with a 
tooltip. 


Having at least two instance to replace, and at least one not to replace 
tells if both gives a hit (As marked in the screenshot)


I used this for test: 


https://lh3.googleusercontent.com/-NmfUa3kcp1k/WLnahgEAbTI/Fek/qSTE3utuFDwY1uQ5eh3YLnFCge6WIZ2hACLcB/s1600/Skjermbilde%2B2017-03-03%2Bkl.%2B21.58.58.png>


Hope this helps. 


–


Ole Kristian Ek Hornnes

Systemkonsulent





søndag 26. februar 2017 10.55.45 UTC+1 skrev Bill Kochman følgende:
>
> Hello again, 
>
> I want to convert all of my relative URLs to absolute URLs. 
>
> The problem is that I do not know where the remaining relative URLs are 
> located in my virtual host's folder. 
>
> I have been reading the grep patterns section of the BBEdit manual, but I 
> still haven't quite understood how to apply what I have been reading. 
>
> For example, many of my current absolute URLs look like the following, 
> where "my-article" represents the actual name of the file: 
>
> https://www.billkochman.com/Articles/my-article.html 
>
> However, there are some places -- as I said, unknown to me -- where there 
> are relative URLs which look like the following: 
>
>  https://www.billkochman.com/Articles/;. 
>
> In looking at the BBEdit grep section, I get the impression that maybe I 
> need to use an "if-then" or "if-then-else" conditional subpattern. However, 
> if that is the case, as I said, I don't quite understand how to implement 
> it. 
>
> If I use this: 
>
> \t\t there because all such lines are prefixed by two tabs. 
>
> So what pattern do I use to convert the remaining relative URLs to 
> absolute URLs, without affecting the current absolute URLs? 
>
> In other words,  https://www.billkochman.com/Articles/my-article.html. 
>
> Thanks in advance. Some of this stuff is just a little over my head. 
>
> Kind regards, 
>
> Bill K. 
>
>

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-02-26 Thread Bill Kochman
Hello Tom,

Thank you very much for that explanation. Yes, it is very helpful and will help 
me to write more complex patterns.

Earlier this morning I was looking through the greg section of the BBEdit 
manual, trying to find what I was referring to as a “not operator”. I even 
checked online, but was unsuccessful.

My reasoning was that I had to write a pattern which looked for “my-doc.html”, 
but not for “https://www.billkochman.com/Articles/my-doc.html 
”.

But now I understand that when the caret is used inside of square brackets, it 
actually does mean “not”, and does not signify the beginning of a line.

So again, your explanation has helped to expand my understanding regarding how 
grep patterns work. I will be archiving this message in Apple Mail for future 
reference.

Regarding relative links versus absolute links, oh gosh, I don’t even want to 
get into it.

Because of my recent conversion to AMP and SSL/TSL, I was going nuts with that 
one, trying to determine which was best.

So I conducted some web surfing, and all that did was make me even more 
confused, because amongst so-called SEO “experts”, there are clearly two 
divided camps, who each offer what they consider valid reasons for their 
particular approach.

I finally settled upon absolute URLs site-wide, the reason being that while 
even Google states that their bots are smart enough to follow relative links, 
using absolute links removes all doubts whatsoever.

Canonical links already have to be absolute, so I figured I should just make 
everything else to match.

Also, I learned through recent personal experience that when you start making 
major site-wide URL changes using BBEdit’s multi-file find and replace, you can 
very easily trip yourself up when ../ and ../../ or deeper are used in certain 
places. You may fix some things, but unknowingly break links in other places. 
Shiela Dixon’s Integrity Plus is a real help in that area.

I am actually in the process of eliminating all of my other domains. I am just 
going to let them expire, so that I can concentrate on just the one. So 
changing hosts is really not an issue with me.

But I am a little confused by your comment regarding sub-directories. If you 
move a folder higher or lower in your virtual host’s folder hierarchy, you do 
have to edit the HTML. You would have to add or remove certain ../, ../../, 
etc., or else the links will be broken.

Also, I tried adding the base URL meta tag to some of my documents, and if I 
recall correctly, the AMP validator reported that it was disallowed, so I 
removed them.

Oddly enough, I read an online comment not too long ago where someone said that 
they were going to add base URL as a valid meta tag. I guess they later decided 
against it. Who knows.

Anyway, to each his own regarding absolute versus relative. Whatever works.

Kind regards,

Bill K.


> On Feb 27, 2017, at 6:09 AM, Tom Robinson  wrote:
> 
> Normally relative links are a better way to run a site — you can move pages 
> to a different host, put them in sub-directories, etc., without changing the 
> HTML.
> 
> 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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-02-26 Thread Tom Robinson
Normally relative links are a better way to run a site — you can move pages to 
a different host, put them in sub-directories, etc., without changing the HTML.

> 
>> And I'd replace with:
>> 
>> https://www.billkochman.com/Articles/\1
>> 
>> Jean-Christophe 

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-02-26 Thread Bill Kochman
Hello Jean-Christophe,

Thank you for your assistance. I appreciate it.

Using that grep pattern found only ONE relative URL in almost 6,000 HTML docs.

Considering how much I have used BBEdit’s multi-file find and replace feature 
to make global changes to my primary virtual host over the past few weeks in 
order to bring it up to specs for AMP, I do find that rather suspect.

In other words, I would think that there would still be at least a few more 
hidden relative URLs floating around on the site, and not just one.

On the other hand, if there really was only one, then I must have done a better 
job than I thought. :)

While I can just copy and paste that grep pattern and use it — which I did in 
fact do — I really learn nothing from the experience.

Having said that, can you please take a few more minutes of your time to 
explain to me what each part of that grep pattern does?

I understand some of it, but not all of it put together.

For example, I know that ^ means the beginning of a line, that $ means the end 
of a line, and * is like a wild card, right?

But put all together with the two brackets and the forward slash, my 
understanding gets lost.

Thank you, my friend.

Kind regards,

Bill Kochman


> On Feb 26, 2017, at 8:41 PM, Jean-Christophe Helary 
>  wrote:
> 
> Bill,

> There is not need to check for the presence of tabs since what you want 
> concerns only the URL.
> 
> Since the relative URLs don't (seem to) include a /, I'd use that pattern to 
> look for them:
> 
> https://www.billkochman.com/Articles/\1
> 
> Jean-Christophe 


-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Help With Grep Pattern

2017-02-26 Thread Jean-Christophe Helary
Bill,

> https://www.billkochman.com/Articles/my-article.html
> 
> https://www.billkochman.com/Articles/;.

> If I use this:
> 
> \t\t there because all such lines are prefixed by two tabs.

There is not need to check for the presence of tabs since what you want 
concerns only the URL.

Since the relative URLs don't (seem to) include a /, I'd use that pattern to 
look for them:

https://www.billkochman.com/Articles/\1

Jean-Christophe 

-- 
This is the BBEdit Talk public discussion group. 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: 
--- 
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.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.