Jump to content
UBot Underground

(Want To Ask) Adding * On Space Between Word


Recommended Posts

Hi, is there a way to add * on a space between word. the example is like this

 

example:

3 word

 

my best city

 

i want to change it to different variation like my * best city, my best * city or my best city*

 

4 word

 

this is my city

i want to change it to different variation like this * is my city, this is * my city, this is my * city, this is my city *

 

for 5,6, 7, or 8 word also have same variation like above.

i try reguler expression. but still confuse how to set a word and change it to different variation. 

 

i dont' know how to do it. may you can help me. thanks a lot.

Edited by taufiqkyu
Link to post
Share on other sites

this should get you started.. :)

 

set(#main phrase,"my best city","Global")
define create variations(#phrase, #insert word) {
    clear list(%variations)
    add item to list(%variations,$replace regular expression(#phrase,"(?<=\\w+)\\s(?=\\w+\\s)",#insert word),"Don\'t Delete","Global")
    alert($list item(%variations,0))
    add item to list(%variations,$replace regular expression(#phrase,"(?<=\\w+\\s\\w+)\\s(?=\\w+)",#insert word),"Don\'t Delete","Global")
    alert($list item(%variations,1))
    add item to list(%variations,$replace regular expression(#phrase,"$",#insert word),"Don\'t Delete","Global")
    alert($list item(%variations,2))
}
create variations("my best city", " * ")

 

 

https://cl.ly/40d00b72e554

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...