I'm trying to extract values from the following statement using Regex , the statement looks like this: from JFK to IND
So, I need to be able to extract JFK
and IND
Can you help in providi开发者_开发百科ng the right regex expression for it?
from\s+(?<origin>[A-Z]{3})\s+to\s+(?<destination>[A-Z]{3})
^from ([A-Z]{3}) to ([A-Z]{3})$
the values you want will be in the two capture groups.
I can't elaborate any more unless you specify what language you are using the regex's in?
精彩评论