regex=/(.*<\x2Fa>)<\x2Fb>/; var ProfileText=regex.exec(PostText); document.write(ProfileText[0]);