regex for shortforms

Posted by Sourabh on Stack Overflow See other posts from Stack Overflow or by Sourabh
Published on 2010-05-18T06:56:57Z Indexed on 2010/05/18 7:00 UTC
Read the original article Hit count: 384

Filed under:
|

I need a regex (JavaScript) which will extract shortforms from a string

for example from below string

Hibbs' essays in progress include "Anselm's Sacramental Imagination," "W.E.B. DuBois and Socratic Questioning," and "Everything That Rises Must Converge: Aquinas's Theological Re-formation of the Cardinal Virtues."

it will match "W.E.B." so the condition is it should have DOTs to seperate the letters

or from

Marcih J. Robert II. Distinguished Professor of Electrical & Computer Engineering. Ph.D. (1977) Texas Tech University, B.S./M.S. Rose-Hulman Institute of Technology (1972/1973).

Ph.D.
B.S.
M.S.

will match

Thanks

© Stack Overflow or respective owner

Related posts about regex

Related posts about JavaScript