Regex: Match anything after a certain character

A simple regular expression to match anything after a certain character.

Today I needed to match everything in a string after a certain character, in this case a quote (“). To accomplish this I needed to do the following:

"(.+$)

The " part can be any character or combination of characters and the (.+$) matches anything (.) to the end of the line ($).

That’s about it, nothing fancy but useful none the less.

Published November 18th, 2009 by Dana Woodman in Reference
Tags ,
Comments No Comments »