Title: case-insensitive detection
Last modified: January 12, 2017

---

# case-insensitive detection

 *  [twykr](https://wordpress.org/support/users/twykr/)
 * (@twykr)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/case-insensitive-detection/)
 * Hey –
 * Suggestion for improvement: Some old content has captialized HTML tags – e.g.“
   <IMG” instead of “<img”.
 * I’d suggest you adjust the plugin code to account for this, by adding the case-
   insensitive flag (“/i”) to the end of your regex calls. That is, in “import-external-
   attachments.php”, around line 309-310, adjust the regex calls to:
 *     ```
       preg_match_all( '/<img[^>]* src=[\'"]?([^>\'" ]+)/i' , $post->post_content , $matches );
       preg_match_all( '/<a[^>]* href=[\'"]?([^>\'" ]+)/i' , $post->post_content , $matches2 );
       ```
   
 * And btw – thanks for maintaining this plugin! Helping a client move from another
   CMS to WordPress, and we don’t have full access to the old site – so this saved
   me hours of manual import work!
 * FWIW,
    twykr.
    -  This topic was modified 9 years, 5 months ago by [twykr](https://wordpress.org/support/users/twykr/).
      Reason: Fixing code line numbers to be correct

Viewing 1 replies (of 1 total)

 *  Thread Starter [twykr](https://wordpress.org/support/users/twykr/)
 * (@twykr)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/case-insensitive-detection/#post-8648218)
 * Addendum thoughts: A couple other features I’d suggest:
 * 1. An “import ONLY from these domains” list option, as sometimes it’ll be easier
   to specific exactly which domains from which to import rather than a long list
   of other sites to block.
 * 2. The ability to ONLY do images, or ONLY do PDF files, rather than doing both
   all of the time.
 * FWIW,
    twykr.

Viewing 1 replies (of 1 total)

The topic ‘case-insensitive detection’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/import-external-attachments.svg)
 * [Import external attachments](https://wordpress.org/plugins/import-external-attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/import-external-attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/import-external-attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/import-external-attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/import-external-attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/import-external-attachments/reviews/)

## Tags

 * [improvement](https://wordpress.org/support/topic-tag/improvement/)

 * 1 reply
 * 1 participant
 * Last reply from: [twykr](https://wordpress.org/support/users/twykr/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/case-insensitive-detection/#post-8648218)
 * Status: not a support question