You can use the keywordsprefix=<prefix> to specify that anything beginning with the <prefix> is considered a a keyword. The MWE below highlights any word beginning with B in blue, but leaves other text alone:

However you should note the following limitations form the listings documentation:
The prefix is always case sensitive.
Only one prefix can be defined at a time.
If used standalone outside a language definition, the key might work only after selecting a nonempty language (and switching back to the empty language if necessary).
The key does not respect the value of classoffset and has no optional class argument.
\documentclass{article}
\usepackage{listings}%
\usepackage{xcolor}
\lstset{%
backgroundcolor=\color{yellow!20},%
basicstyle=\small\ttfamily,%
numbers=left, numberstyle=\tiny, stepnumber=2, numbersep=5pt,%
keywordstyle=\color{blue}\bfseries,
language=Java,
keywordsprefix=B,
}%
\begin{document}
\begin{lstlisting}
ABC BGT DEF
BLE XYZ MWS
BNE DNW QES
ABN BEQ MWE
\end{lstlisting}
\end{document}