Thanks to everyone's help so far, I think I am getting better with
Regular expressions...
Need a little help on this one
This is sample data, not accurate..
1. St Joes (15-0)
.875
(2-0)
2. Kentucky (12-2)
.850
(1-0)
10. Kansas (12-2)
.778
(1-1)
198 Crappy School (2-9)
.233
and on and on..
I am trying to match only the schools name, and I have the following reg
ex
if (/^\d\.\s([A-Z]\D+)/) (This says match starting at the beginning of
the line a digit followed by a period followed by a space followed by a
Capital letter followed by any amount of nondigit characters)
This matches the schools that are 1 through 9, but not 10-200.
What is the best way to say match 1, 2 or 3 numbers? With a plus after
the \d or do can I tell it to specifically match only 1 2 or 3 digits?
Also, this is returning the first parentheses mark "(". How do I tell
it not to match that... I know I have to replace \D+ but what with?
What is the metacharacter if there is one to just match a letter?
Thanks,
Taylor