How to deal with padded inputs in a fully connected feed forward network?
If you use fully connected neural network, it will be hard to do what you want. There's no inductive bias to easily generalize from different positions of the strings which you need to extract. 

I suggest you use Seq2Seq models here: http://cs224d.stanford.edu/papers/seq2seq.pdf