Greetings friends,
I am trying to do a global find and replace on a folder of 1,154 BBEdit documents. The operation needs to be very precise, as otherwise, it will REALLY mess me up, and will result in hours — if not days — of unnecessary work on my part.
At the moment, all of my BBB articles have a header at the top, part of which looks like this:
Last Updated: Jan. 10, 2011
The Year 2000 Hype, Aliens, Spirit Helpers, Channelers And
Esoteric Knowledge, Propagation Of New Age Thought, Sheldon
Nidle, UFO Mass Landings, Photon Belt, The Ascension Point,
False Prophets & Charlatans Exposed By Time, The 2012 Hype,
Stanley A. Fulham And The Transcendors, Weeds And Parable Of
Wheat & Tares, Measuring Rod Of God's Word, Strong Delusion,
Beware Of Time-Based Predictions, Verify The Reliability Of
Source Information, Failed Predictions Weaken Faith In God's
Word, Modern Scoffers And Christ's Return, Satan's Scheme To
Discredit True Prophets Of God, True Faith Does Not Require
Evidence Signs Or Miracles, Modern Apostasy, Mary Apparition
In Wisconsin, Decline Of Roman Catholicism And Mary Worship,
Evil Generation Seeks A Sign, Jewish Elders Demanded A Sign,
Jewish Religious Elders Concealed Evidence Of Resurrection
The body of text you see above is obviously different in each article, and followed by three blank lines. Then the main body of the article begins.
To give you a quick background, I have been working on creating my own GPT at
chatgpt.com for the past two weeks. However, my GPT has MAJOR problems with parsing text, accurate data retrieval, misattributions, hallucinations, inventions, etc.
So one thing I though to do was to clarify that the above text after the date is actually the synopsis before the main body of each article. So what I am trying to do is to add the word “Synopsis", following by a divider on a new line, then the above text, followed by another divider on a new line, followed by three blank lines. In other words, the end product should look like this:
Last Updated: Jan. 10, 2011
Synopsis:
<==========================================================>
The Year 2000 Hype, Aliens, Spirit Helpers, Channelers And
Esoteric Knowledge, Propagation Of New Age Thought, Sheldon
Nidle, UFO Mass Landings, Photon Belt, The Ascension Point,
False Prophets & Charlatans Exposed By Time, The 2012 Hype,
Stanley A. Fulham And The Transcendors, Weeds And Parable Of
Wheat & Tares, Measuring Rod Of God's Word, Strong Delusion,
Beware Of Time-Based Predictions, Verify The Reliability Of
Source Information, Failed Predictions Weaken Faith In God's
Word, Modern Scoffers And Christ's Return, Satan's Scheme To
Discredit True Prophets Of God, True Faith Does Not Require
Evidence Signs Or Miracles, Modern Apostasy, Mary Apparition
In Wisconsin, Decline Of Roman Catholicism And Mary Worship,
Evil Generation Seeks A Sign, Jewish Elders Demanded A Sign,
Jewish Religious Elders Concealed Evidence Of Resurrection
<==========================================================>
The dates are different for every article, as is the text of the synopsis. As such I have tried to use something like the following in the find field:
Last Updated: (.+?)\. (.+?), ([0-9][0-9][0-9][0-9])\n\n(.+?)\n\n\n\n
The problem is that I cannot figure out what to use to cover the main text part of the synopsis which is AFTER ([0-9][0-9][0-9][0-9])\n\n and BEFORE \n\n\n\n. You can see that I have added a final (.+?) for the main text of the syopsis. However, when I use that, the text is not being highlighted, so that is apparently wrong.
In the replace field, I am currently using the following, where \4 represents the main text part of the synopsis:
Last Updated: \1\. \2, \3\n\nSynopsis:\n\n<==========================================================>\n\n\4<==========================================================>\n\n\n\n
Not only can I not find the right syntax to represent the text part of the synopsis, but If I run it just like that, with the actual text included in the replace field -- instead of the final (.+?) -- BBEdit throws up this error: