I have a statement like Data lva_var type Integer value 20
. I need to find out the token after type
.
My latest try was [type](?:\s\S+)
, but the match was e integer
.
Code snippets would be helpful.
I have a statement like Data lva_var type Integer value 20
. I need to find out the token after type
.
My latest try was [type](?:\s\S+)
, but the match was e integer
.
Code snippets would be helpful.
Just try this, type\s(\w+)
Here the first group contains the word next to "type"
Hope this code helps.
You can use lookbehind for this (?<=\btype\s)(\w+)
will do the trick for you. Take a look at this example.
JavaScript doesn't support lookbehinds, but since you tagged nsregularexpression
and that does support them, maybe try this: (?<=\btype\s+)\w+