Craig Gallagher
Craig Gallagher

Reputation: 1633

Regular expression lowercase letter followed by a number

I'm trying to get the hang of regular expression. I'm scanning through an xml file and I want to do is find any word starting with a lowercase letter fallowed by a number e.g. c1234I assume it's something like [a-z 0-9] but it's finding single characters instead of a whole word. Any ideas on how to do this would really be appreciated.

Upvotes: 1

Views: 144

Answers (2)

EgoPingvina
EgoPingvina

Reputation: 823

About regex you can read here: https://msdn.microsoft.com/ru-ru/library/az24scfc(v=vs.110).aspx

test your regex you can here: http://www.regexlib.com/RETester.aspx

I think, you help this construction: \b[a-z]\d+

Upvotes: 1

ThePerplexedOne
ThePerplexedOne

Reputation: 2950

[a-z]\d+ will work just fine.

It looks for any lowercase letter followed by any amount of digits.

Upvotes: 2

Related Questions