I have the following string:
"select model (field1, field2, field3, ...)"
And I would like to write something that extracts the words where model and the fields are.
So for instance:
select Car (door, wheel, antenna)
Method 1 returns Car
.
Method 2 returns List/Array {door, wheel, antenna}
So in other words, I am looking for extractModel()
and extractFields()
.
I feel like RegEx
is needed here, but I don't know how to tackle this problem.