For example, in this text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu tellus vel nunc pretium lacinia. Proin sed lorem. Cras sed ipsum. Nunc a libero quis risus sollicitudin imperdiet.
I want to match the word after ‘ipsum’.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This sounds like a job for lookbehinds, though you should be aware that not all regex flavors support them. In your example:
This will match any sequence of letter characters which follows ‘ipsum’ as a whole word followed by a space. It does not match ‘ipsum’ itself, you don’t need to worry about reinserting it in the case of, e.g. replacements.
As I said, though, some flavors (JavaScript, for example) don’t support lookbehind at all. Many others (most, in fact) only support ‘fixed width’ lookbehinds — so you could use this example but not any of the repetition operators. (In other words,
(?<=\b\w+\s+)(\w+)wouldn’t work.)