Search notes:

Regular expressions: start and end of line ($, ^)

^ and $ are zero width regular expression anchors that match the beginning or end of the matched string.
With multi line mode, ^ also matches right after a new line, $ right before a new line.

PowerShell examples

By default $ matches at the end of a string, but not before a new line;
PS C:\> "one`ntwo`nthree" -replace '$', ' EOT'
one
two
three EOT
With multi line mode, $ also matches before an end of line:
PS C:\> "one`ntwo`nthree" -replace '(?m)$', ' EOL'
one EOL
two EOL
three EOL
It should be noted that the .NET regular expression engine only considers \n (0x0a) to be a new line, but not \r\n (0x0d 0x0a).
PS C:\> "foo`nbar" -match '(?m)o$'
True

PS C:\> "foo`r`nbar" -match '(?m)o$'
False

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199563, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/regular-expressions/anchors/start-end-of-line/index(58): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78