Title: string operations
Last modified: September 28, 2022

---

# string operations

 *  Resolved [ernstwg](https://wordpress.org/support/users/ernstwg/)
 * (@ernstwg)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/string-operations/)
 * I want to use slug as an extension to specific external websites url, something
   like [https://website1/](https://website1/)../slug
 * It can happen easily that slug has a suffix like ‘-1’, ‘-2’ and so on. With MLA
   regular expression methods (extract, replace) I tried to remove this suffix, 
   but was not successful.
 * Thank you in advance, Ernst-Wilhelm

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

 *  Thread Starter [ernstwg](https://wordpress.org/support/users/ernstwg/)
 * (@ernstwg)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/string-operations/#post-16051290)
 * It seems that I got it with `[+slug,replace('/(\\-\\d)/','')+]` 🙂
 * Thanks for all your help, Ernst Wilhelm
    -  This reply was modified 3 years, 8 months ago by [ernstwg](https://wordpress.org/support/users/ernstwg/).
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/string-operations/#post-16053053)
 * Thanks for the question and thanks for posting your solution before I could answer
   it.
 * Looks good to me. I discovered some time back that older WordPress versions did
   not add the dash before the numeral. You might check your older items to see 
   if that affects you.
 * I will leave this topic resolved, but please update it if you have any problems
   or further questions with the replacements.

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

The topic ‘string operations’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/string-operations/#post-16053053)
 * Status: resolved