How to substring a value that is being pulled from another field

I am trying to pull a value from one field into another field and then substring the value to only 4 characters. Here is how I have the field set-up:

Regular Express is set to {{Field_Name1}} --This is the field name of the field I am pulling the value from, this appears to be working

Formula is set to str[field(Current_Field1)1,4] – This is where I am having the problem, how do I substring this field to only 4 characters in length?

You can treat a string as an array in Ruby and specify a range using the “…” range operator to extract a substring:

field('Current_Field1')[0..4]

Here’s a working example: http://www.mockaroo.com/101b5960

Thank you for the help!