i want a regex pattern that accepts from 3 to 6 digits.. and only A,M or G at the end
eg:
1234G

What have you come up with so far?

\b\d{3,6}[amg]\b

Select Case in sensitive

I don't find any prob with the above one.

how about this :
^[0-9]{3,6}[a|m|g]$

I don't find any prob with the above one.

how about this :
^[0-9]{3,6}[a|m|g]$

*we should use ^ and $ only if the string contains 3-6numbers ending with a|m|g.
*[a|m|g] should be used if anyone letter should be matched, it doesn't match for "am".

I doesn't know xanawa's requirement, so he can change according to it.

ty so much :)

ty so much :)

Remind that, You Should UpVote if Someone Help's you!!

Remind that, You Should UpVote if Someone Help's you!!

freddie how can i do so?

freddie how can i do so?

You Find an Up arrow and Down arrow in right Corner of each answer, Clicking uparrow votes, and clicking down arrow Downvotes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.