Finding words containing numbers and letters
Posted: Mon Aug 20, 2012 10:42 am
Hello guys,
Making an aviation website, and wanting to breakdown a string, such as this:
"COPES J75 GVE J37 SJI LEV A649 COKER UA649 PAZ UJ55 DATUL DATUL2A"
I made a regex expression, /\w+\b +[A-Z][0-9]+ \w+\b/, but it only picks up COPES J75 GVE and LEV A649 COKER. My goal for this is for it to pick up COPES J75 GVE, GVE J37 SJI, LEV A649 COKER, UA649 PAZ, and UJ55 DATUL.
However, the expression I made will not pick up two lettered words with numbers, just single lettered words. It also doesn't pick up duplicates, like "GVE" in more than one usage.
If anything else needs to be explained, I'll be happy to do so into more detail.
Thanks!
Making an aviation website, and wanting to breakdown a string, such as this:
"COPES J75 GVE J37 SJI LEV A649 COKER UA649 PAZ UJ55 DATUL DATUL2A"
I made a regex expression, /\w+\b +[A-Z][0-9]+ \w+\b/, but it only picks up COPES J75 GVE and LEV A649 COKER. My goal for this is for it to pick up COPES J75 GVE, GVE J37 SJI, LEV A649 COKER, UA649 PAZ, and UJ55 DATUL.
However, the expression I made will not pick up two lettered words with numbers, just single lettered words. It also doesn't pick up duplicates, like "GVE" in more than one usage.
If anything else needs to be explained, I'll be happy to do so into more detail.
Thanks!