[a-zA-Z0-9]+
basically any mix of lower and uppercase letters and digits, but it can't be only a digit (must have letters).
Does that answer your question?
Main Topics
Browse All TopicsHello,
I have a regex I am struggling with.
Input:
<tr>
<td width="140" class="datahl2"> </td
<td width="90" class="datahl2b">Offense</
<td width="90" class="datahl2b">Defense</
<td class="datahl4b" width="90"> </td>
<td width="90" class="datahl2b">Offense</
<td width="90" class="datahl2b">Defense</
</tr>
<tr>
<td class="datahl2">
<strong>Points</strong><br
>1st third word Quarter<br>
2nd Quarter<br>
3rd Quarter<br>
4th Quarter
<td class="datacell">
<strong>96.4</strong><br>
24.7<br>
23.2<br>
21.9<br>
25.1</td>
Desired output:
Offense
Defense
Offense
Defense
Points
1st third word Quarter
2nd Quarter
3rd Quarter
4th Quarter
I tried the for several hours to construct a regex to do this, and came close, but it matches each individual word (ex: matches "2nd", then matches "Quarter", but not "2nd Quarter"). In general I am struggling with Repetition and Extended Regular expression but I am slowly learning.
Much thanks,
sapbucket
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I think it can be done with one regex?
This gets pretty close:
(?<![\w])[a-zA-Z0-9]+(?>)
See how it matches each individual string of characters? For example: "1st" then "third" then "word" then "Quarter" (total of 4 matches). I want it to match the whole thing, for example: "1st third word Quarter" would be matched (for a total of 1 match).
Anyone know how to do that?
[Contents of the file dinesh.txt]
<tr>
<td width="140" class="datahl2"> </td
<td width="90" class="datahl2b">Offense</
<td width="90" class="datahl2b">Defense</
<td class="datahl4b" width="90"> </td>
<td width="90" class="datahl2b">Offense</
<td width="90" class="datahl2b">Defense</
</tr>
<tr>
<td class="datahl2">
<strong>Points</strong><br
>1st third word Quarter<br>
2nd Quarter<br>
3rd Quarter<br>
4th Quarter
<td class="datacell">
<strong>96.4</strong><br>
24.7<br>
23.2<br>
21.9<br>
25.1</td>
[Contents of the file dinesh.txt]
To show the expected output at shell on linux oriented platforms or at at "Cygwin bash shell" on Windows :
sed 's/<.[^>]*>//g;s/ //g
This can also be done with the input given at the terminal itself Command:
sed 's/<.[^>]*>//g;s/ //g
Press enter
Give the input.
Press enter
Press Control D
This will show the output.
mgh,
That's just about it! If you can show me one more thing I will award you the points.
sample input:
<strong>Points</strong><br
1st Quarter<br>
2nd Quarter<br>
3rd Quarter<br>
4th Quarter
<td class="datacell">
Regex I tried: (mgh's)
(?!>| )(\b[0-9]?[a-zA-Z]+ ?)+(?:<)
Sample output:
Points<
1st Quarter<
2nd Quarter<
3rd Quarter<
See how it doesn't match 4th Quarter (because '<' is on the next line)?
Is there a way to match 4th Quarter?
I've been wondering about how to use those options. However, you are using what looks like PERL. I am using C# and do not know the notation to use /igsm. Your second option does not work for me because of this.
Your first option doesn't match "4th Quarter" so it also doesn't work.
If your solution does work I need to figure out how to use /igsm with C#. Anyone know?
Business Accounts
Answer for Membership
by: ddrudikPosted on 2007-12-27 at 14:08:25ID: 20537702
What criteria are you using to consider a "match"?