use of regex -- PS

Jesse Phillips jessekphillips+D at
Sun Jan 9 15:48:01 PST 2011

If you want your regular expression which matches at the begging of the string you use ^ (carrot). A regex is for describing what it takes to make a match, if your regex doesn't use this than it can match anywhere in the string. So to me having a match and find is redundant. I mean what does find do when you have ^ and $ surrounding the expression?

spir Wrote:

> Hello again,
> I also have an issue with the func 'match': instead of simply trying to match and fail if not found, it seems to search for a matching snippet all along the source: what a method 'find' or 'search' usually does, as opposed to 'match' precisely. Thus, i'm forced to prefix all regex patterns with '^'.
> What am I missing?
> (If I'm not missing anything, would be useful to have match vs find, don't you think?)
> Denis
> -- -- -- -- -- -- --
> vit esse estrany ☣

More information about the Digitalmars-d-learn mailing list