开发者

Regex expression statement pattern

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜