Regular expressions are great for doing these sorts of tasks. There are lots of regex resources on the web and at least this and this I've posted in the community. In the example above, you could compare last == fixed to determine if you need to rename the directory.
I don't understand what you want to do with an IP address. You can't use JMP's rename functions to do anything to a URL. Rename only works on a disk that you have read/write access.
However, you can manipulate a URL (using regex or other JSL functions) before using it. For example, you could parse the URL for this page and rebuild it. The JSL could use regex, or words(URL,"/"), or other string functions.
URL="community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/m-p/45142";
w = words(URL,"/");
{"community.jmp.com", "t5", "Discussions",
"Change-folder-name-where-the-jmp-file-is-stored", "m-p", "45142"}
You could manipulate that list and rebuild the string
w[5] = "xyzzy";
concatitems( w ,"/");
"community.jmp.com/t5/Discussions/Change-folder-name-where-the-jmp-file-is-stored/xyzzy/45142"
That's a 404-page not found URL, of course.
Craige