Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Using regexp


Level 3

Hello everybody

In a textfield, I have got several lines with a carriage return. I would like to delete only the last carriage return of the last line. How can I do that with a regexp. In InDesign, the regexp is : search (?=\r)\r and replace with nothing.

But in LiveCycle

In the exit event:

var str = this.rawValue;

this.rawValue = str.replace(/ what here? /,"");

Many thanks

1 Reply


Level 10


have you tried replace(/?=\r/g, "") ?

There are a few limitations in EcmaScript used by Acrobat/Readers JavaScript engine, so lookaheads or lookbehinds in regular expresions aren't supported. I currently don't remember which one it was.