Search This Blog

Wednesday, April 3, 2019

Holy CRAP!! I FEEL DUMB!!

It started with this query on 3/29/2019:

Can I use Regular Expressions to replace this:
|
<title>CTE/Voice Services/Grandstream Patient Room Phones - External Resources</title>

With this:

<title>CTE - Voice Services - Grandstream Patient Room Phones - External Resources</title>
|

Since that innocent query, the amount of knowledge I've been trying to process is staggering. Every time I think about learning how to code by taking a Kirkwood class or through Lynda.com, I read something like this link on stack overflow that Chris M sent to me in his effort to help me solve this and shake my head. So much of that page goes sailing over my head! I think, “You’re a dumb English major that didn’t know what he was doing in 1994 and typed “c:\del *.*” in DOS (when I really wanted to just delete .txt files, but I didn’t know I could type “C:\del *.txt”.

Then I think about how I *know* now (today) that “c:\del *.*” was a dumb thing to type and that I have learned so much about DOS since then, by reading sites like stack overflow, by experimenting, by asking questions of Chris, Brian C, and anyone else I come in contact with via email or the Internet.

That brings me back to wanting to use that gnawing feeling of “I’m really stupid and could never learn this stuff” as motivation to do just that: learn it! Time will tell if I learn as much about regular expressions as I have learned about DOS!

I went back to earlier in the process of trying to figure this out because I thought I had seen where the command (see, I don’t even know if I call the things I’m trying to create “commands” or “expressions” or something else!) would look inside the <title> tag. That led me back to https://regexr.com/4bdf0 and guess what?

It seems to work for me. I ran it over my directory and it was working like I expected. I then replaced the <title> & </title> tags with <h1> & </h1> because I have the same type of thing within the Heading 1 tags. Preliminary results are encouraging!

I’m lucky in that I can regenerate these HTML pages any time I want and they are stored within a single directory (c:\rh\drdoc\e-r) which means if I screw something over, I simply regenerate the files and don’t paint myself into a corner by “permanently” mucking up my files.

So, crossing fingers, I think I have it!

No comments: