Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identify text in quotes

Status
Not open for further replies.

AA2K5

Programmer
Apr 24, 2002
31
0
0
GB
Hi,

I just want to thank PHV for all the help with my last couple of AWK questions (especially the quick and accurate code snippets).

I've got another question about pattern matching. I'm trying to identify text within single quotes so I can ignore it when I'm looking for a keyword.

For example I want keyword to be matched but not '..keyword...'.

If I could rely on there being only one set of single quotes on a line then this would be straightforward to implement. Unfortunately, I could have a case of there being several sets of single quotes on a single line i.e.

'some text' and a keyword and 'another keyword here'

Here I'd want to match the first keyword and not the second, but I'm having the problem of the quotes around both being identified and therefore both are being ignored.

I hope someone can help me.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top