cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
cabeza
Nintex Newbie

Substring to Get Certain Number of Letters From The Right

The fn-Substring(a,b,c) is useful when we start count from the string left side.
What if i want to get the x number of characters from the right side where the strings can have different length?
For example if X=4
The input for:
Abcd-1234
Ab(xyz)1234
Abcdefxyz1234
All need to give the Output as 1234

Labels: (1)
Tags (1)
0 Kudos
Reply
3 Replies
mlauer
Nintex Newbie

Re: Substring to Get Certain Number of Letters From The Right

You can use a regular expression. Result will be assigned to a single line text variable:

 

grafik.png

if you want it to be exactly four digits, use \d{4,4} instead of \d+.

0 Kudos
Reply
cabeza
Nintex Newbie

Re: Substring to Get Certain Number of Letters From The Right

Thank you Mlauer for your reply,
But sorry couldnt get it to work, or maybe I missed something.
in my example, when i mentioned 1234, i mean any four alphanumiric characters, it doesnt mean the last for letters are always numbers,
also the input string is not always the same size, it can be any number of alphanumeric string

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Substring to Get Certain Number of Letters From The Right

To get 4 last characters of a string use:

.*(.{4,4})$

0 Kudos
Reply