Newbie help with regular expression
Kwok Peng Tuck <[email protected]> Tue, 06 Aug 2002 07:51:35 +0800
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm new to regular expression and would like some help/thoughts with the following questions. I have a configuration file which looks a bit like this: group = core .............. ............. ............. ............... group = smsbox ............................ ............................ ........................... ........................... My first question is : How do I correctly write a regular expression that will let me say give me the contents of the group = core ? I tried this \s*group\s*=\s*core\s*([^>]*)\s*group\s*=\s*smsbox\s* but that isn't really working as it would depend on group = smsbox being there. Is there a way around this ? My second question is this: How can I extract multiple identical groups ( for example there are many 'group = smsbox' ) ? I would like to extract all the groups that match. My apologies if my questions aren't clear to anyone, I will clarify if I need to. Thank you.