The following Regular Expressions were helpful in cleaning up Content from D2L Brighspace (.html files) in preparation for import into Instructure Canvas. You should be able to use the following Regular Expressions in any text editor that supports multi-file GREP searching. We have found success using the tags in the following order as well.
-
Download Content from Manage Files in your Brightspace course.
-
Unzip the Content on your local computer.
-
Open an HTML file using a text editor that supports multi-file GREP searching, e.g. BBEdit.
-
Run each expression.
After running each expression, we would zip the files back up and upload them back to the manage files area where they would be unzipped. At this point, clean up would continue in the Brightspace course until it was ready for export and import into Canvas.
Find: <!--(.*?)-->
Replace: null
Find: <header(.*?)>[^"]*</header>
Replace: null
Find: <div(.*?)>
Replace: null
Find: </div>
Replace: null
Find: <section(.*?)>
Replace: null
Find: </section>
Replace: null
Find: <article(.*?)>
Replace: null
Find: </article>
Replace: null
Find: <link(.*?)>
Replace: null
Note: Will remove <link>
tags where ever they are in the file.
Find: <aside
Replace: <p
Find: </aside>
Replace: </p>
Find: <figure
Replace: <p
Find: </figure>
Replace: </p>
Find: <figcaption>
Replace: <br /><span style="font-size: .75em; padding-left: auto; padding-right: auto;">
Find: </figcaption>
Replace: </span>
Find: <footer(.*?)>[^"]*</footer>
Replace: null
Find: <g(.*?)>
Replace: null
- Remove Grammerly Close Tags
Find:
</g>
Replace:null
Find: <iframe(.*?)>
(.*?)
[^"]*