שלום,
אני מעתיק לפעמים קטעי קוד ממוספרים מהרשת שנראים כך:
קוד: |
3.
4. /**
5. This program tests regular expression matching.
6. Enter a pattern and strings to match, or hit Cancel
7. to exit. If the pattern contains groups, the group
8. boundaries are displayed in the match.
9. */
10. public class RegExTest
11. {
12. public s |
אני מעוניין להפוך את המספור להערות, אני יודע שבPerl אפשר להעביר חלק מהביטוי שמחליפים כפמרמטר למה שמחליף כלומר משהו כזה:
קוד: |
s/^(...)/\/\*$1\/\*/g |
למישהו יש מושג איך עושים כזה דבר ב vim?