Copy link to clipboard
Copied
How do I write a regular expression to replace everything after the 2nd occurrence of a period?
Copy link to clipboard
Copied
Ah OK. I think a Regular Expression is a bit of an overkill for that.
You can do it using this code:
var s = "123.456.78910.1234";
var parts = s.split(".");
var newS = (parts.length<2) ? parts[0] : parts[0]+"."+parts[1];
console.println(newS);
Copy link to clipboard
Copied
what app? acrobat? animate? something else?
Copy link to clipboard
Copied
Acrobat (JavaScript)
Copy link to clipboard
Copied
in the future, to find the best place to post your message, use the list here, https://community.adobe.com/
p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.
<"moved from using the community">
Copy link to clipboard
Copied
All of your previous messages are in Acrobat About formsdoctor - Adobe Community
Is this another Acrobat message?
Copy link to clipboard
Copied
Yes
Copy link to clipboard
Copied
Replace it with what?
Copy link to clipboard
Copied
Remove it. Replace with ""
Copy link to clipboard
Copied
Ah OK. I think a Regular Expression is a bit of an overkill for that.
You can do it using this code:
var s = "123.456.78910.1234";
var parts = s.split(".");
var newS = (parts.length<2) ? parts[0] : parts[0]+"."+parts[1];
console.println(newS);