So here is the scenario I have a field that cantains a series of text and numbers, clearly its a string field. within this field there may appear the word LOAN # or Loan NO or even Just Loan: typically after this there will be a 10 digit number. My goal is to extract the number that follows.If I could simply extract the number and perhaps any characters that come between the word Loan and the ten digit number, then I could clean that new field to contain just numbers and Im golden. I have figured out how to identify if the word Loan appears in the field, I just cant figure out the rest. the difficulty with this is that the word loan and the loan number do not fall in the same place in the field, if they are there at all. The field where this string is is called 'Comment 03' the field where I would like to move the loan number to is called 'LoanNumber'
Solved! Go to Solution.
This worked for me but can you explain what its doing? Im not sure I understand the expression and how the parts are working.
@Inactive User
.*(?i)LOAN.*?(\d{10}).*
The .* means zero or more characters, and (?i) flags case-insensitive, so it will work for both "LOAD" or "load".
So totally, zero or more characters before and after "LOAN", then follows 10 digit numberbs, then zero or more characters.
You may find this website very useful.