You are viewing limited content. For full access, please sign in.

Question

Question

Access each character of a string

asked on October 16, 2015

I have an LF web form that users fill in and it auto-populates a state form PDF. That's all straight forward. My sticking point is that they enter their SS# on the web form in a text field. The PDF has an individual field for each digit of the SS#. I need to take each digit of the string they enter and populate each SS# digit field on the PDF. Any ideas of how I can do this?

I've looked at the LF token functions but don't see any that splits every character into an indexed token, or a function that allows me to retrieve a specific character in a string and I don't know of a way that regex can retrieve a specific individual character (3rd, 4th, 5th character, etc.).

Any help is appreciated.

0 0

Answer

SELECTED ANSWER
replied on October 17, 2015

if you know the format of your item it;s easy to do regexes for individual char.

 

\d\d\d\-(\d)\d-\d\d\d\d   will return the 4th number in the SS that has dashes. The () indicates the area you actually want to return. 

 

The key is making sure it's standardized before you try to extract (i.e. it either always has the dashes or it never has them!)

0 0
replied on October 18, 2015

That worked perfectly - thank you!

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.