You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gnu_awk.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ Resources mentioned in Acknowledgements section are available under original lic
66
66
67
67
## Book version
68
68
69
-
1.0
69
+
1.1
70
70
See [Version_changes.md](https://github.com/learnbyexample/learn_gnuawk/blob/master/Version_changes.md) to track changes across book versions.
71
71
72
72
# Installation and Documentation
@@ -691,11 +691,11 @@ part time
691
691
692
692
You have seen a few metacharacters and escape sequences that help to compose a regular expression. To match the metacharacters literally, i.e. to remove their special meaning, prefix those characters with a `\` character. To indicate a literal `\` character, use `\\`.
693
693
694
-
Unlike `grep` and `sed`, the line anchors have to be always escaped to match them literally. They do not lose their special meaning when not used in their customary positions.
694
+
Unlike `grep` and `sed`, the line anchors have to be always escaped to match them literally as there is no BRE mode in `awk`. They do not lose their special meaning when not used in their customary positions.
695
695
696
696
```bash
697
697
$ # awk '/b^2/' will not work even though ^ isn't being used as anchor
698
-
$ #however, b^2 will work for both grep and sed
698
+
$ # b^2 will work for both grep and sed if you use BRE syntax
Both the above examples can also be easily solved using `FPAT` or `patsplit`. `match` has an advantage when it comes to getting portions matched only within capture groups. The first element of array will still have the entire match. Second element will contain portion matched by first group, third element will contain portion matched by second group and so on.
3067
+
Both the above examples can also be easily solved using `FPAT` or `patsplit`. `match` has an advantage when it comes to getting portions matched only within capture groups. The first element of array will still have the entire match. Second element will contain portion matched by first group, third element will contain portion matched by second group and so on. See also [stackoverflow: arithmetic replacement in a text file](https://stackoverflow.com/questions/62241101/arithmetic-replacement-in-a-text-file).
0 commit comments