>> English << | česky | Deutsch | Español ZVON > Tutorials > Regular Expressions Tutorial
>> Example 24 << | Prev | Next | Contents | Regular Expressions

Description


\A matches the beginning of string. It is similar to ^, but ^ will match after each newline, if multiline strings are considered. Similarly, \Z matches only at the end of the string or before newline at the end of it. It is similar to $, but $ will match before each newline.

Source


Ere iron was found or tree was hewn,    When young was mountain under moon; Ere ring was made, or wrought was woe,    It walked the forests long ago.

Case 1


Regular Expression: \A...
First match:Ere iron was found or tree was hewn, When young was mountain under moon; Ere ring was made, or wrought was woe, It walked the forests long ago.
All matches:Ere iron was found or tree was hewn, When young was mountain under moon; Ere ring was made, or wrought was woe, It walked the forests long ago.

Case 2


Regular Expression: ...\Z
First match:Ere iron was found or tree was hewn, When young was mountain under moon; Ere ring was made, or wrought was woe, It walked the forests long ago.
All matches:Ere iron was found or tree was hewn, When young was mountain under moon; Ere ring was made, or wrought was woe, It walked the forests long ago.