Damn, I’ve gotten rusty at regex. Modern search tools are just too darn smart and handy.
Can someone without Google-induced lazy forgettery tell me how to search and select from [beginning of line][short string][to end of line including newline] ?
Damn, I’ve gotten rusty at regex. Modern search tools are just too darn smart and handy.
Can someone without Google-induced lazy forgettery tell me how to search and select from [beginning of line][short string][to end of line including newline] ?
If the beginning-of-line anchor is important, I’d use (“foobar” is the short string in your example
Beginning-of-line anchor, string, “skip anything”, end-of-line anchor
ummm, does the string immediately follow the start of a line? If it doesn’t, we’d have to do a “match anything except”, and I’m pretty sure you can only do that when the exception (in this case, it’s the first char of the string we’re searching for) is a single character.
Here’s my collection of handy regex tools:
Regex Cheat sheet
Regex tester
Another cheat sheet.* (slightly more comprehensive)* warning: pdf
^ is the beginning of line ancor
shortstring is interpreted literally
.* matches any number of other characters
$ is the end of line anchor.
So / ^shortstring.*$ /