Title: Issue adding space with regular expression
Last modified: July 16, 2021

---

# Issue adding space with regular expression

 *  Resolved [rughjm](https://wordpress.org/support/users/rughjm/)
 * (@rughjm)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/issue-adding-space-with-regular-expression/)
 * Hi. Thank you for this plugin. I can already tell it is going to save me a bunch
   of time.
 * I am trying to copy the data in title field to the alt text field. I followed
   your guide [here](https://wordpress.org/support/topic/bulk-edit-title-alt-tag-descripion-and-so-on-broken-on/#post-9389349)
   and was able to get it to work.
 * However, some of the titles include “-” and I need those replaced with a simple
   space. I am using `template:[+post_title,replace( '/-/', ' ')+]` in the EXIF/
   Template Value field. This removes the “-” but does not insert a space. I have
   tried other variables in the “r” argument and those return just fine. I also 
   copy and pasted the code in the documentation directly and it also does not return
   a space.
 * > For a simple example, ,replace( {‘/,/’ ‘/-/’}, {‘ ‘ ‘_’} ) will change commas
   > to spaces and dashes to underscores, while ,replace( {‘/,/’ ‘/-/’}, ‘ ‘ ) will
   > change both commas and dashes to spaces.
 * Are you able to help me figure out why a space is not being returned?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/issue-adding-space-with-regular-expression/#post-14672285)
 * Thanks for your positive feedback, your question and for the details of your 
   template; very helpful. You have encountered two small defects in the current
   MLA version that do not handle “spaces” in the replacement value.
 * I have uploaded a new MLA Development Version dated 20210717 that corrects the
   problem. You can find step-by-step instructions for using the Development Version
   in this earlier topic:
 * [PHP Warning on media upload with Polylang](https://wordpress.org/support/topic/php-warning-on-media-upload-with-polylang/#post-9625341)
 * Once the Development Version is installed you can verify that the template you’ve
   developed is handled properly.
 * The fixes will be in my next MLA version shortly after WordPress 5.8 is released.
   In the interim, it would be great if you could install the Development Version
   and let me know if it works for you. Thanks for alerting me to this issue and
   for your interest in the plugin.
 *  Thread Starter [rughjm](https://wordpress.org/support/users/rughjm/)
 * (@rughjm)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/issue-adding-space-with-regular-expression/#post-14676470)
 * It worked! Thank you very much.
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/issue-adding-space-with-regular-expression/#post-14699766)
 * Thanks for testing the Development Version and confirming the fix.
 * I have released MLA version 2.96, which contains the fix for this defect. I am
   marking this topic resolved, but please update it if you have trouble with the
   new version. Thanks again for your help with this issue.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Issue adding space with regular expression’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/issue-adding-space-with-regular-expression/#post-14699766)
 * Status: resolved