Norton,
In addition to the other suggestions, I would strongly recommend both
Expresso & RegEx Workbench, as they both have wizards of varying degrees
to help you build your expression, plus they allow you to test your
expressions, also the analyzer/interpreter in each is rather handy
Expresso:
http://www.ultrapico.com/Expresso.htm
RegEx Workbench:
http://www.gotdotnet.com/Community/...pleGuid=c712f2df-b026-4d58-8961-4ee2729d7322A
tutorial & reference on using regular
expressions:
http://www.regular-expressions.info/The MSDN's documentation
on regular
expressions:
http://msdn.microsoft.com/library/d...pconRegularExpressionsLanguageElements.aspFor
an example of using Expresso, if you enter the following in the
RegularExpression
tab:\[(?<Date>\d{4}-\d{2})\]\s*-?\s*(?<Artist>\w*)\s*-?\s*(?<Album>\w*)(\s*-?\s*\[(?<Quality>\w*)\])?Then
enter the following, in the Sample Input Data:[2005-01] - Artist -
Album[2005-01] Artist - Album[2005-01] - Artist - Album
[123kbps][2005-01] - Artist - Album-[123kbps]You can click the Run Match
button, the Result of Search and Replace willgive you a tree with your
results. It will show one node for each line thatmatched, if you expand a
node, it will show you the parameters that matched(in this case Date,
Artist, Album & Quality). Then numbered match (1: in thetree) is just a
place holder as the entire Quality is optional...As you select nodes in
the Results tree, the source is selected in theSample Input Area.Very
useful tool!NOTE: The expression is a solution to your question.Hope this
messageHello,>> Does any
one know how to extact the following text into 4 different> groups(namely
Date, Artist, Album and Quality)?> [2005-01] - Artist - Album> [2005-01]
Artist - Album> [2005-01] - Artist - Album [123kbps]> [2005-01] - Artist -
Album-[123kbps]>> i have try this syntax but it failed>
\[?<Date>[^\]]*\]\s-\s(?<Artist>\b)\s-\s(?<Album>[^[]*)>> Thx a lot>>
Regards,> Norton>>