This file is indexed.

/usr/share/doc/vim/html/pattern.html is in vim-doc 2:8.0.1453-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-type" content="text/html; charset=ISO-8859-1">
<TITLE>Vim documentation: pattern</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>Vim documentation: pattern</H1>
<A NAME="top"></A>
<A HREF="index.html">main help file</A>

<HR>
<PRE>

*<A NAME="pattern.txt"></A><B>pattern.txt</B>*   For Vim version 8.0.  Last change: 2017 Jun 05


		  VIM REFERENCE MANUAL    by <A HREF="intro.html#Bram">Bram</A> <A HREF="intro.html#Moolenaar">Moolenaar</A>



Patterns and search commands				*<A NAME="pattern-searches"></A><B>pattern-searches</B>*

The very basics can be found in section |<A HREF="usr_03.html#03.9">03.9</A>| of the user manual.  A few more
explanations are in chapter 27 |<A HREF="usr_27.html">usr_27.txt</A>|.

1. Search commands		|<A HREF="#search-commands">search-commands</A>|
2. The definition of a pattern	|<A HREF="#search-pattern">search-pattern</A>|
3. Magic			|<A HREF="#/magic">/magic</A>|
4. Overview of pattern items	|<A HREF="#pattern-overview">pattern-overview</A>|
5. Multi items			|<A HREF="#pattern-multi-items">pattern-multi-items</A>|
6. Ordinary atoms		|<A HREF="#pattern-atoms">pattern-atoms</A>|
7. Ignoring case in a <A HREF="#pattern">pattern</A>	|<A HREF="#/ignorecase">/ignorecase</A>|
8. Composing characters		|<A HREF="#patterns-composing">patterns-composing</A>|
9. Compare with <A HREF="if_perl.html#Perl">Perl</A> patterns	|<A HREF="#perl-patterns">perl-patterns</A>|
10. Highlighting matches	|<A HREF="#match-highlight">match-highlight</A>|

==============================================================================

1. Search commands				*<A NAME="search-commands"></A><B>search-commands</B>*


							*<A NAME="/"></A><B>/</B>*
/{pattern}[/]&lt;CR&gt;	Search forward for the [count]'th occurrence of
			{pattern} |<A HREF="motion.html#exclusive">exclusive</A>|.

/{pattern}/{offset}&lt;CR&gt;	Search forward for the [count]'th occurrence of
			{pattern} and go |<A HREF="#{offset}">{offset}</A>| lines up or down.
			|<A HREF="motion.html#linewise">linewise</A>|.


							*<A NAME="/&lt;CR&gt;"></A><B>/&lt;CR&gt;</B>*
<A HREF="#/&lt;CR&gt;">/&lt;CR&gt;</A>			Search forward for the [count]'th occurrence of the
			latest used pattern |<A HREF="#last-pattern">last-pattern</A>| with latest used
			|<A HREF="#{offset}">{offset}</A>|.

//{offset}&lt;CR&gt;		Search forward for the [count]'th occurrence of the
			latest used pattern |<A HREF="#last-pattern">last-pattern</A>| with new
			|<A HREF="#{offset}">{offset}</A>|.  If {offset} is empty no offset is used.


							*<A NAME="?"></A><B>?</B>*
?{pattern}[?]&lt;CR&gt;	Search backward for the [count]'th previous
			occurrence of {pattern} |<A HREF="motion.html#exclusive">exclusive</A>|.

?{pattern}?{offset}&lt;CR&gt;	Search backward for the [count]'th previous
			occurrence of {pattern} and go |<A HREF="#{offset}">{offset}</A>| lines up or
			down |<A HREF="motion.html#linewise">linewise</A>|.


							*<A NAME="?&lt;CR&gt;"></A><B>?&lt;CR&gt;</B>*
<A HREF="#?&lt;CR&gt;">?&lt;CR&gt;</A>			Search backward for the [count]'th occurrence of the
			latest used pattern |<A HREF="#last-pattern">last-pattern</A>| with latest used
			|<A HREF="#{offset}">{offset}</A>|.

??{offset}&lt;CR&gt;		Search backward for the [count]'th occurrence of the
			latest used pattern |<A HREF="#last-pattern">last-pattern</A>| with new
			|<A HREF="#{offset}">{offset}</A>|.  If {offset} is empty no offset is used.


							*<A NAME="n"></A><B>n</B>*
<A HREF="#n">n</A>			Repeat the latest &quot;<A HREF="#/">/</A>&quot; or &quot;<A HREF="#?">?</A>&quot; <A HREF="intro.html#[count]">[count]</A> times.
			If the cursor doesn't move the search is repeated with
			<A HREF="intro.html#count">count</A> + 1.
			|<A HREF="#last-pattern">last-pattern</A>| {Vi: no count}


							*<A NAME="N"></A><B>N</B>*
N			Repeat the latest &quot;<A HREF="#/">/</A>&quot; or &quot;<A HREF="#?">?</A>&quot; <A HREF="intro.html#[count]">[count]</A> times in
			opposite direction. |<A HREF="#last-pattern">last-pattern</A>| {Vi: no count}


							*<A NAME="star"></A><B>star</B>* *<A NAME="E348"></A><B>E348</B>* *<A NAME="E349"></A><B>E349</B>*
*			Search forward for the [count]'th occurrence of the
			<A HREF="motion.html#word">word</A> nearest to the cursor.  The <A HREF="motion.html#word">word</A> used for the
			search is the first of:
				1. the keyword under the cursor |<A HREF="options.html#'iskeyword'">'iskeyword'</A>|
				2. the first keyword after the cursor, in the
				   current line
				3. the non-blank <A HREF="motion.html#word">word</A> under the cursor
				4. the first non-blank <A HREF="motion.html#word">word</A> after the cursor,
				   in the current line
			Only whole keywords are searched for, like with the
			command &quot;/\&lt;keyword\&gt;&quot;.  |<A HREF="motion.html#exclusive">exclusive</A>|  {not in Vi}
			<A HREF="options.html#'ignorecase'">'ignorecase'</A> is used, <A HREF="options.html#'smartcase'">'smartcase'</A> is not.


							*<A NAME="#"></A><B>#</B>*
#			Same <A HREF="motion.html#as">as</A> &quot;*&quot;, but search backward.  The pound sign
			(character 163) also works.  If the &quot;<A HREF="##">#</A>&quot; key works <A HREF="motion.html#as">as</A>
			backspace, try using &quot;stty erase &lt;BS&gt;&quot; before starting
			Vim (&lt;BS&gt; is <A HREF="motion.html#CTRL-H">CTRL-H</A> or a real backspace).  {not in Vi}


							*<A NAME="gstar"></A><B>gstar</B>*
g*			Like &quot;*&quot;, but don't put &quot;\&lt;&quot; and &quot;\&gt;&quot; around the <A HREF="motion.html#word">word</A>.
			This makes the search also find matches that are not a
			whole <A HREF="motion.html#word">word</A>.  {not in Vi}


							*<A NAME="g#"></A><B>g#</B>*
<A HREF="#g#">g#</A>			Like &quot;<A HREF="##">#</A>&quot;, but don't put &quot;\&lt;&quot; and &quot;\&gt;&quot; around the <A HREF="motion.html#word">word</A>.
			This makes the search also find matches that are not a
			whole <A HREF="motion.html#word">word</A>.  {not in Vi}


							*<A NAME="gd"></A><B>gd</B>*
<A HREF="#gd">gd</A>			Goto local Declaration.  When the cursor is on a local
			variable, this command will jump to its declaration.
			First Vim searches for the start of the current
			function, just like &quot;<A HREF="motion.html#[[">[[</A>&quot;.  If <A HREF="motion.html#it">it</A> is not found the
			search stops in line 1.  If <A HREF="motion.html#it">it</A> is found, Vim goes back
			until a blank line is found.  From this position Vim
			searches for the keyword under the cursor, like with
			&quot;*&quot;, but lines that look like a comment are ignored
			(see <A HREF="options.html#'comments'">'comments'</A> option).
			Note that this is not guaranteed to work, Vim does not
			really check the <A HREF="syntax.html#syntax">syntax</A>, <A HREF="motion.html#it">it</A> only searches for a match
			with the keyword.  If included files also need to be
			searched use the commands listed in |<A HREF="tagsrch.html#include-search">include-search</A>|.
			After this command |<A HREF="#n">n</A>| searches forward for the next
			match (not backward).
			{not in Vi}


							*<A NAME="gD"></A><B>gD</B>*
<A HREF="#gD">gD</A>			Goto global Declaration.  When the cursor is on a
			global variable that is defined in the file, this
			command will jump to its declaration.  This works just
			like &quot;<A HREF="#gd">gd</A>&quot;, except that the search for the keyword
			always starts in line 1.  {not in Vi}


							*<A NAME="1gd"></A><B>1gd</B>*
<A HREF="#1gd">1gd</A>			Like &quot;<A HREF="#gd">gd</A>&quot;, but ignore matches inside a <A HREF="intro.html#{}">{}</A> block that
			ends before the cursor position. {not in Vi}


							*<A NAME="1gD"></A><B>1gD</B>*
<A HREF="#1gD">1gD</A>			Like &quot;<A HREF="#gD">gD</A>&quot;, but ignore matches inside a <A HREF="intro.html#{}">{}</A> block that
			ends before the cursor position. {not in Vi}


							*<A NAME="CTRL-C"></A><B>CTRL-C</B>*
<A HREF="#CTRL-C">CTRL-C</A>			Interrupt current (search) command.  Use CTRL-Break on
			<A HREF="os_msdos.html#MS-DOS">MS-DOS</A> |<A HREF="os_dos.html#dos-CTRL-Break">dos-CTRL-Break</A>|.
			In <A HREF="intro.html#Normal">Normal</A> mode, any pending command is aborted.


							*<A NAME=":noh"></A><B>:noh</B>* *<A NAME=":nohlsearch"></A><B>:nohlsearch</B>*
:noh[lsearch]		Stop the highlighting for the <A HREF="options.html#'hlsearch'">'hlsearch'</A> option.  It
			is automatically turned back on when using a search
			command, or setting the <A HREF="options.html#'hlsearch'">'hlsearch'</A> option.
			This command doesn't work in an <A HREF="autocmd.html#autocommand">autocommand</A>, because
			the highlighting state is saved and restored when
			executing autocommands |<A HREF="autocmd.html#autocmd-searchpat">autocmd-searchpat</A>|.
			Same thing for when invoking a user function.

While typing the search <A HREF="#pattern">pattern</A> the current match will be shown if the
<A HREF="options.html#'incsearch'">'incsearch'</A> option is on.  Remember that you still have to finish the search
command with <A HREF="motion.html#&lt;CR&gt;">&lt;CR&gt;</A> to actually position the cursor at the displayed match.  Or
use <A HREF="intro.html#&lt;Esc&gt;">&lt;Esc&gt;</A> to <A HREF="editing.html#abandon">abandon</A> the search.

All matches for the last used search <A HREF="#pattern">pattern</A> will be highlighted if you set
the <A HREF="options.html#'hlsearch'">'hlsearch'</A> option.  This can be suspended with the |<A HREF="#:nohlsearch">:nohlsearch</A>| command.


When no match is found you get the error: *<A NAME="E486"></A><B>E486</B>* <A HREF="#Pattern">Pattern</A> not found
Note that for the |<A HREF="repeat.html#:global">:global</A>| command this behaves like a normal message, for <A HREF="intro.html#Vi">Vi</A>
compatibility.  For the |<A HREF="change.html#:s">:s</A>| command the &quot;<A HREF="motion.html#e">e</A>&quot; flag can be used to avoid the
error message |<A HREF="change.html#:s_flags">:s_flags</A>|.


					*<A NAME="search-offset"></A><B>search-offset</B>* *<A NAME="{offset}"></A><B>{offset}</B>*
These commands search for the specified <A HREF="#pattern">pattern</A>.  With &quot;<A HREF="#/">/</A>&quot; and &quot;<A HREF="#?">?</A>&quot; an
additional offset may be given.  There are two types of offsets: line offsets
and character offsets.  {the character offsets are not in Vi}

The offset gives the cursor position relative to the found match:
    [num]	[num] lines downwards, in column 1
    +[num]	[num] lines downwards, in column 1
    -[num]	[num] lines upwards, in column 1
    e[+num]	[num] characters to the right of the end of the match
    e[-num]	[num] characters to the left of the end of the match
    s[+num]	[num] characters to the right of the start of the match
    s[-num]	[num] characters to the left of the start of the match
    b[+num]	[num] identical to s[+num] above (mnemonic: begin)
    b[-num]	[num] identical to s[-num] above (mnemonic: begin)
    ;{pattern}  perform another search, see |<A HREF="#//;">//;</A>|

If a '<A HREF="motion.html#-">-</A>' or '<A HREF="motion.html#+">+</A>' is given but [num] is omitted, a <A HREF="intro.html#count">count</A> of one will be used.
When including an offset with '<A HREF="motion.html#e">e</A>', the search becomes <A HREF="motion.html#inclusive">inclusive</A> (the
character the cursor lands on is included in operations).

Examples:

<B><FONT COLOR="PURPLE">pattern			cursor position	</FONT></B>
/test/+1		one line below &quot;test&quot;, in column 1
/test/e			on the last t of &quot;test&quot;
/test/s+2		on the '<A HREF="change.html#s">s</A>' of &quot;test&quot;
/test/b-3		three characters before &quot;test&quot;

If one of these commands is used after an <A HREF="motion.html#operator">operator</A>, the characters between
the cursor position before and after the search is affected.  However, if a
line offset is given, the whole lines between the two cursor positions are
affected.

An example of how to search for matches with a <A HREF="#pattern">pattern</A> and change the match
with another <A HREF="motion.html#word">word</A>:
<B>	/foo&lt;CR&gt;	find "foo"</B>
<B>	c//e&lt;CR&gt;	change until end of match</B>
<B>	bar&lt;Esc&gt;	type replacement</B>
<B>	//&lt;CR&gt;		go to start of next match</B>
<B>	c//e&lt;CR&gt;	change until end of match</B>
<B>	beep&lt;Esc&gt;	type another replacement</B>
<B>			etc.</B>
 

							*<A NAME="//;"></A><B>//;</B>* *<A NAME="E386"></A><B>E386</B>*
A very special offset is '<A HREF="motion.html#;">;</A>' followed by another search command.  For example:

<B>   /test 1/;/test</B>
<B>   /test.*/+1;?ing?</B>

The first one first finds the next occurrence of &quot;test 1&quot;, and then the first
occurrence of &quot;test&quot; after that.

This is like executing two search commands after each other, except that:
- It can be used <A HREF="motion.html#as">as</A> a single motion command after an <A HREF="motion.html#operator">operator</A>.
- The direction for a following &quot;<A HREF="#n">n</A>&quot; or &quot;<A HREF="#N">N</A>&quot; command comes from the first
  search command.
- When an error occurs the cursor is not moved at all.


							*<A NAME="last-pattern"></A><B>last-pattern</B>*
The last used <A HREF="#pattern">pattern</A> and offset are remembered.  They can be used to repeat
the search, possibly in another direction or with another <A HREF="intro.html#count">count</A>.  Note that
two patterns are remembered: One for 'normal' search commands and one for the
substitute command &quot;<A HREF="change.html#:s">:s</A>&quot;.  Each time an empty <A HREF="#pattern">pattern</A> is given, the previously
used <A HREF="#pattern">pattern</A> is used.  However, if there is no previous search command, a
previous substitute <A HREF="#pattern">pattern</A> is used, if possible.

The <A HREF="options.html#'magic'">'magic'</A> option sticks with the last used <A HREF="#pattern">pattern</A>.  If you change <A HREF="options.html#'magic'">'magic'</A>,
this will not change how the last used <A HREF="#pattern">pattern</A> will be interpreted.
The <A HREF="options.html#'ignorecase'">'ignorecase'</A> option does not <A HREF="diff.html#do">do</A> this.  When <A HREF="options.html#'ignorecase'">'ignorecase'</A> is changed, <A HREF="motion.html#it">it</A>
will result in the <A HREF="#pattern">pattern</A> to match other text.

All matches for the last used search <A HREF="#pattern">pattern</A> will be highlighted if you set
the <A HREF="options.html#'hlsearch'">'hlsearch'</A> option.

To clear the last used search <A HREF="#pattern">pattern</A>:
<B>	:let @/ = ""</B>
This will not set the <A HREF="#pattern">pattern</A> to an empty <A HREF="eval.html#string">string</A>, because that would match
everywhere.  The <A HREF="#pattern">pattern</A> is really cleared, like when starting Vim.

The search usually skips matches that don't move the cursor.  Whether the next
match is found at the next character or after the skipped match depends on the
'c' flag in <A HREF="options.html#'cpoptions'">'cpoptions'</A>.  See |<A HREF="options.html#cpo-c">cpo-c</A>|.
	   with '<A HREF="change.html#c">c</A>' flag:   &quot;/...&quot; advances 1 to 3 characters
	without '<A HREF="change.html#c">c</A>' flag:   &quot;/...&quot; advances 1 character
The unpredictability with the '<A HREF="change.html#c">c</A>' flag is caused by starting the search in the
first column, skipping matches until one is found past the cursor position.

When searching backwards, searching starts at the start of the line, using the
'<A HREF="change.html#c">c</A>' flag in <A HREF="options.html#'cpoptions'">'cpoptions'</A> <A HREF="motion.html#as">as</A> described above.  Then the last match before the
cursor position is used.

In <A HREF="intro.html#Vi">Vi</A> the &quot;<A HREF="tagsrch.html#:tag">:tag</A>&quot; command sets the last search <A HREF="#pattern">pattern</A> when the <A HREF="tagsrch.html#tag">tag</A> is searched
for.  In Vim this is not done, the previous search <A HREF="#pattern">pattern</A> is still remembered,
unless the '<A HREF="motion.html#t">t</A>' flag is present in <A HREF="options.html#'cpoptions'">'cpoptions'</A>.  The search <A HREF="#pattern">pattern</A> is always
put in the search <A HREF="cmdline.html#history">history</A>.

If the <A HREF="options.html#'wrapscan'">'wrapscan'</A> option is on (which is the default), searches wrap around
the end of the buffer.  If <A HREF="options.html#'wrapscan'">'wrapscan'</A> is not set, the backward search stops
at the beginning and the forward search stops at the end of the buffer.  If
<A HREF="options.html#'wrapscan'">'wrapscan'</A> is set and the <A HREF="#pattern">pattern</A> was not found the error message &quot;<A HREF="#pattern">pattern</A>
not found&quot; is given, and the cursor will not be moved.  If <A HREF="options.html#'wrapscan'">'wrapscan'</A> is not
set the message becomes &quot;search hit BOTTOM without match&quot; when searching
forward, or &quot;search hit TOP without match&quot; when searching backward.  If
wrapscan is set and the search wraps around the end of the file the message
&quot;search hit TOP, continuing at BOTTOM&quot; or &quot;search hit BOTTOM, continuing at
TOP&quot; is given when searching backwards or forwards respectively.  This can be
switched off by setting the '<A HREF="change.html#s">s</A>' flag in the <A HREF="options.html#'shortmess'">'shortmess'</A> option.  The highlight
method '<A HREF="motion.html#w">w</A>' is used for this message (default: <A HREF="syntax.html#standout">standout</A>).


							*<A NAME="search-range"></A><B>search-range</B>*
You can limit the search command &quot;<A HREF="#/">/</A>&quot; to a certain range of lines by including
\&#37;&gt;l items.  For example, to match the <A HREF="motion.html#word">word</A> &quot;limit&quot; below line 199 and above
line 300:
<B>	/\%&gt;199l\%&lt;300llimit</B>
Also see |<A HREF="#/\&#37;&gt;l">/\&#37;&gt;l</A>|.

Another way is to use the &quot;<A HREF="change.html#:substitute">:substitute</A>&quot; command with the '<A HREF="change.html#c">c</A>' flag.  Example:
<B>   :.,300s/Pattern//gc</B>
This command will search from the cursor position until line 300 for
&quot;<A HREF="#Pattern">Pattern</A>&quot;.  At the match, you will be asked to type a character.  Type '<A HREF="repeat.html#q">q</A>' to
stop at this match, type '<A HREF="#n">n</A>' to find the next match.

The &quot;*&quot;, &quot;<A HREF="##">#</A>&quot;, &quot;g*&quot; and &quot;<A HREF="#g#">g#</A>&quot; commands look for a <A HREF="motion.html#word">word</A> near the cursor in this
order, the first one that is found is used:
- The keyword currently under the cursor.
- The first keyword to the right of the cursor, in the same line.
- The <A HREF="motion.html#WORD">WORD</A> currently under the cursor.
- The first <A HREF="motion.html#WORD">WORD</A> to the right of the cursor, in the same line.
The keyword may only contain letters and characters in <A HREF="options.html#'iskeyword'">'iskeyword'</A>.
The <A HREF="motion.html#WORD">WORD</A> may contain any non-blanks (&lt;Tab&gt;s and/or &lt;Space&gt;s).
Note that if you type with ten fingers, the characters are <A HREF="starting.html#easy">easy</A> to remember:
the &quot;<A HREF="##">#</A>&quot; is under your left hand middle finger (search to the left and up) and
the &quot;*&quot; is under your right hand middle finger (search to the right and down).
(this depends on your keyboard layout though).

==============================================================================

2. The definition of a <A HREF="#pattern">pattern</A>		*<A NAME="search-pattern"></A><B>search-pattern</B>* *<A NAME="pattern"></A><B>pattern</B>* *<A NAME="[pattern]"></A><B>[pattern]</B>*

					*<A NAME="regular-expression"></A><B>regular-expression</B>* *<A NAME="regexp"></A><B>regexp</B>* *<A NAME="Pattern"></A><B>Pattern</B>*

					*<A NAME="E76"></A><B>E76</B>* *<A NAME="E383"></A><B>E383</B>* *<A NAME="E476"></A><B>E476</B>*

For starters, read chapter 27 of the user manual |<A HREF="usr_27.html">usr_27.txt</A>|.


						*<A NAME="/bar"></A><B>/bar</B>* *<A NAME="/\bar"></A><B>/\bar</B>* *<A NAME="/pattern"></A><B>/pattern</B>*
1. A <A HREF="#pattern">pattern</A> is one or more branches, separated by &quot;\|&quot;.  It matches anything
   that matches one of the branches.  Example: &quot;foo\|beep&quot; matches &quot;foo&quot; and
   matches &quot;beep&quot;.  If more than one branch matches, the first one is used.

   <A HREF="#pattern">pattern</A> ::=	    branch
		or  branch \| branch
		or  branch \| branch \| branch
		etc.


						*<A NAME="/branch"></A><B>/branch</B>* *<A NAME="/\&amp;"></A><B>/\&amp;</B>*
2. A branch is one or more concats, separated by &quot;\&amp;&quot;.  It matches the last
   concat, but only if all the preceding concats also match at the same
   position.  Examples:
	&quot;foobeep\&amp;...&quot; matches &quot;foo&quot; in &quot;foobeep&quot;.
	&quot;.*Peter\&amp;.*Bob&quot; matches in a line containing both &quot;Peter&quot; and &quot;Bob&quot;

   branch ::=	    concat
		or  concat \&amp; concat
		or  concat \&amp; concat \&amp; concat
		etc.


						*<A NAME="/concat"></A><B>/concat</B>*
3. A concat is one or more pieces, concatenated.  It matches a match for the
   first piece, followed by a match for the second piece, etc.  Example:
   &quot;f[0-9]b&quot;, first matches &quot;<A HREF="motion.html#f">f</A>&quot;, then a digit and then &quot;<A HREF="motion.html#b">b</A>&quot;.

   concat  ::=	    piece
		or  piece piece
		or  piece piece piece
		etc.


						*<A NAME="/piece"></A><B>/piece</B>*
4. A piece is an atom, possibly followed by a multi, an indication of how many
   times the atom can be matched.  Example: &quot;a*&quot; matches any sequence of &quot;<A HREF="insert.html#a">a</A>&quot;
   characters: &quot;&quot;, &quot;<A HREF="insert.html#a">a</A>&quot;, &quot;aa&quot;, etc.  See |<A HREF="#/multi">/multi</A>|.

   piece   ::=	    atom
		or  atom  multi


						*<A NAME="/atom"></A><B>/atom</B>*
5. An atom can be one of a long <A HREF="eval.html#list">list</A> of items.  Many atoms match one character
   in the text.  It is often an ordinary character or a character class.
   Braces can be used to make a <A HREF="#pattern">pattern</A> into an atom.  The &quot;\z(\)&quot; construct
   is only for <A HREF="syntax.html#syntax">syntax</A> highlighting.

   atom    ::=	    ordinary-atom		|<A HREF="#/ordinary-atom">/ordinary-atom</A>|
		or  \( <A HREF="#pattern">pattern</A> \)		|<A HREF="#/\(">/\(</A>|
		or  \&#37;( <A HREF="#pattern">pattern</A> \)		|<A HREF="#/\&#37;(">/\&#37;(</A>|
		or  \z( <A HREF="#pattern">pattern</A> \)		|<A HREF="syntax.html#/\z(">/\z(</A>|



				*<A NAME="/\&#37;#="></A><B>/\&#37;#=</B>* *<A NAME="two-engines"></A><B>two-engines</B>* *<A NAME="NFA"></A><B>NFA</B>*
Vim includes two <A HREF="#regexp">regexp</A> engines:
1. An old, backtracking engine that supports everything.
2. A new, <A HREF="#NFA">NFA</A> engine that works much faster on some patterns, possibly slower
   on some patterns.

Vim will automatically select the right engine for you.  However, if you run
into a problem or want to specifically select one engine or the other, you can
prepend one of the following to the <A HREF="#pattern">pattern</A>:

	\&#37;#=0	Force automatic selection.  Only has an effect when
	        <A HREF="options.html#'regexpengine'">'regexpengine'</A> has been set to a non-zero value.
	\&#37;#=1	Force using the old engine.
	\&#37;#=2	Force using the <A HREF="#NFA">NFA</A> engine.

You can also use the <A HREF="options.html#'regexpengine'">'regexpengine'</A> option to change the default.


			 *<A NAME="E864"></A><B>E864</B>* *<A NAME="E868"></A><B>E868</B>* *<A NAME="E874"></A><B>E874</B>* *<A NAME="E875"></A><B>E875</B>* *<A NAME="E876"></A><B>E876</B>* *<A NAME="E877"></A><B>E877</B>* *<A NAME="E878"></A><B>E878</B>*
If selecting the <A HREF="#NFA">NFA</A> engine and <A HREF="motion.html#it">it</A> runs into something that is not implemented
the <A HREF="#pattern">pattern</A> will not match.  This is only useful when debugging Vim.

==============================================================================

3. Magic							*<A NAME="/magic"></A><B>/magic</B>*

Some characters in the <A HREF="#pattern">pattern</A> are taken literally.  They match with the same
character in the text.  When preceded with a <A HREF="intro.html#backslash">backslash</A> however, these
characters get a special meaning.

Other characters have a special meaning without a <A HREF="intro.html#backslash">backslash</A>.  They need to be
preceded with a <A HREF="intro.html#backslash">backslash</A> to match literally.

If a character is taken literally or not depends on the <A HREF="options.html#'magic'">'magic'</A> option and the
items mentioned next.

							*<A NAME="/\m"></A><B>/\m</B>* *<A NAME="/\M"></A><B>/\M</B>*
Use of &quot;\m&quot; makes the <A HREF="#pattern">pattern</A> after <A HREF="motion.html#it">it</A> be interpreted <A HREF="motion.html#as">as</A> if <A HREF="options.html#'magic'">'magic'</A> is set,
ignoring the actual value of the <A HREF="options.html#'magic'">'magic'</A> option.
Use of &quot;\M&quot; makes the <A HREF="#pattern">pattern</A> after <A HREF="motion.html#it">it</A> be interpreted <A HREF="motion.html#as">as</A> if <A HREF="options.html#'nomagic'">'nomagic'</A> is used.

							*<A NAME="/\v"></A><B>/\v</B>* *<A NAME="/\V"></A><B>/\V</B>*
Use of &quot;\v&quot; means that in the <A HREF="#pattern">pattern</A> after <A HREF="motion.html#it">it</A> all ASCII characters except
'0'-'9', 'a'-'z', 'A'-'Z' and '<A HREF="motion.html#_">_</A>' have a special meaning.  &quot;very magic&quot;

Use of &quot;\V&quot; means that in the <A HREF="#pattern">pattern</A> after <A HREF="motion.html#it">it</A> only the <A HREF="intro.html#backslash">backslash</A> and the
terminating character (/ or ?) has a special meaning.  &quot;very nomagic&quot;

Examples:
<B><FONT COLOR="PURPLE">after:	  \v	   \m	    \M	     \V		matches </FONT></B>
		<A HREF="options.html#'magic'">'magic'</A> <A HREF="options.html#'nomagic'">'nomagic'</A>
	  $	   $	    $	     \$		matches end-of-line
	  .	   .	    \.	     \.		matches any character
	  &#42;	   &#42;	    \*	     \*		any number of the previous atom
	  ~	   ~	    \~	     \~		latest substitute <A HREF="eval.html#string">string</A>
	  ()	   \(\)     \(\)     \(\)	grouping into an atom
	  &#124;	   \&#124;	    \&#124;	     \&#124;		separating alternatives
	  \a	   \a	    \a	     \a		alphabetic character
	  \\	   \\	    \\	     \\		literal <A HREF="intro.html#backslash">backslash</A>
	  \.	   \.	    .	     .		literal dot
	  \{	   {	    {	     {		literal '<A HREF="motion.html#{">{</A>'
	  a	   a	    a	     a		literal '<A HREF="insert.html#a">a</A>'

{only Vim supports \m, \M, \v and \V}

It is recommended to always keep the <A HREF="options.html#'magic'">'magic'</A> option at the default setting,
which is <A HREF="options.html#'magic'">'magic'</A>.  This avoids portability problems.  To make a <A HREF="#pattern">pattern</A> immune
to the <A HREF="options.html#'magic'">'magic'</A> option being set or not, put &quot;\m&quot; or &quot;\M&quot; at the start of the
<A HREF="#pattern">pattern</A>.

==============================================================================

4. Overview of <A HREF="#pattern">pattern</A> items				*<A NAME="pattern-overview"></A><B>pattern-overview</B>*

						*<A NAME="E865"></A><B>E865</B>* *<A NAME="E866"></A><B>E866</B>* *<A NAME="E867"></A><B>E867</B>* *<A NAME="E869"></A><B>E869</B>*


Overview of multi items.				*<A NAME="/multi"></A><B>/multi</B>* *<A NAME="E61"></A><B>E61</B>* *<A NAME="E62"></A><B>E62</B>*

More explanation and examples below, follow the links.		*<A NAME="E64"></A><B>E64</B>* *<A NAME="E871"></A><B>E871</B>*

<B><FONT COLOR="PURPLE">	  multi </FONT></B>
<B><FONT COLOR="PURPLE">     'magic' 'nomagic'	matches of the preceding atom </FONT></B>
|<A HREF="#/star">/star</A>|	&#42;	\*	0 or more	<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible
|<A HREF="#/\+">/\+</A>|	\+	\+	1 or more	<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (*)
|<A HREF="#/\=">/\=</A>|	\=	\=	0 or 1		<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (*)
|<A HREF="#/\?">/\?</A>|	\?	\?	0 or 1		<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (*)

|<A HREF="#/\{">/\{</A>|	\{n,m}	\{n,m}	<A HREF="#n">n</A> to <A HREF="motion.html#m">m</A>		<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (*)
	\{n}	\{n}	<A HREF="#n">n</A>		exactly (*)
	\{n,}	\{n,}	at least <A HREF="#n">n</A>	<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (*)
	\{,m}	\{,m}	0 to <A HREF="motion.html#m">m</A>		<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (*)
	\{}	\{}	0 or more	<A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (same <A HREF="motion.html#as">as</A> *) (*)

|<A HREF="#/\{-">/\{-</A>|	\{-n,m}	\{-n,m}	<A HREF="#n">n</A> to <A HREF="motion.html#m">m</A>		<A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible (*)
	\{-n}	\{-n}	<A HREF="#n">n</A>		exactly (*)
	\{-n,}	\{-n,}	at least <A HREF="#n">n</A>	<A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible (*)
	\{-,m}	\{-,m}	0 to <A HREF="motion.html#m">m</A>		<A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible (*)
	\{-}	\{-}	0 or more	<A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible (*)


							*<A NAME="E59"></A><B>E59</B>*
|<A HREF="#/\@&gt;">/\@&gt;</A>|	\@&gt;	\@&gt;	1, like matching a whole <A HREF="#pattern">pattern</A> (*)
|<A HREF="#/\@=">/\@=</A>|	\@=	\@=	nothing, requires a match |<A HREF="#/zero-width">/zero-width</A>| (*)
|<A HREF="#/\@!">/\@!</A>|	\@!	\@!	nothing, requires NO match |<A HREF="#/zero-width">/zero-width</A>| (*)
|<A HREF="#/\@&lt;=">/\@&lt;=</A>|	\@&lt;=	\@&lt;=	nothing, requires a match behind |<A HREF="#/zero-width">/zero-width</A>| (*)
|<A HREF="#/\@&lt;!">/\@&lt;!</A>|	\@&lt;!	\@&lt;!	nothing, requires NO match behind |<A HREF="#/zero-width">/zero-width</A>| (*)

(*) {not in Vi}



Overview of ordinary atoms.				*<A NAME="/ordinary-atom"></A><B>/ordinary-atom</B>*
More explanation and examples below, follow the links.

<B><FONT COLOR="PURPLE">      ordinary atom </FONT></B>
<B><FONT COLOR="PURPLE">      magic   nomagic	matches </FONT></B>
|<A HREF="#/^">/^</A>|	^	^	start-of-line (at start of <A HREF="#pattern">pattern</A>) |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\^">/\^</A>|	\^	\^	literal '^'
|<A HREF="#/\_^">/\_^</A>|	\_^	\_^	start-of-line (used anywhere) |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/$">/$</A>|	$	$	end-of-line (at end of <A HREF="#pattern">pattern</A>) |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\$">/\$</A>|	\$	\$	literal '$'
|<A HREF="#/\_$">/\_$</A>|	\_$	\_$	end-of-line (used anywhere) |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/.">/.</A>|	.	\.	any single character (not an end-of-line)
|<A HREF="#/\_.">/\_.</A>|	\_.	\_.	any single character or end-of-line
|<A HREF="#/\&lt;">/\&lt;</A>|	\&lt;	\&lt;	beginning of a <A HREF="motion.html#word">word</A> |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\&gt;">/\&gt;</A>|	\&gt;	\&gt;	end of a <A HREF="motion.html#word">word</A> |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\zs">/\zs</A>|	\zs	\zs	anything, sets start of match
|<A HREF="#/\ze">/\ze</A>|	\ze	\ze	anything, sets end of match

|<A HREF="#/\&#37;^">/\&#37;^</A>|	\&#37;^	\&#37;^	beginning of file |<A HREF="#/zero-width">/zero-width</A>|		*<A NAME="E71"></A><B>E71</B>*
|<A HREF="#/\&#37;$">/\&#37;$</A>|	\&#37;$	\&#37;$	end of file |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\&#37;V">/\&#37;V</A>|	\&#37;V	\&#37;V	inside <A HREF="visual.html#Visual">Visual</A> area |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\&#37;#">/\&#37;#</A>|	\&#37;#	\&#37;#	cursor position |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\&#37;'m">/\&#37;'m</A>|	\&#37;'m	\&#37;'m	<A HREF="motion.html#mark">mark</A> m position |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\&#37;l">/\&#37;l</A>|	\&#37;23l	\&#37;23l	in line 23 |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\&#37;c">/\&#37;c</A>|	\&#37;23c	\&#37;23c	in column 23 |<A HREF="#/zero-width">/zero-width</A>|
|<A HREF="#/\&#37;v">/\&#37;v</A>|	\&#37;23v	\&#37;23v	in virtual column 23 |<A HREF="#/zero-width">/zero-width</A>|


Character classes {not in Vi}:				*<A NAME="/character-classes"></A><B>/character-classes</B>*
<B><FONT COLOR="PURPLE">      magic   nomagic	matches </FONT></B>
|<A HREF="#/\i">/\i</A>|	\i	\i	identifier character (see <A HREF="options.html#'isident'">'isident'</A> option)
|<A HREF="#/\I">/\I</A>|	\I	\I	like &quot;\i&quot;, but excluding digits
|<A HREF="#/\k">/\k</A>|	\k	\k	keyword character (see <A HREF="options.html#'iskeyword'">'iskeyword'</A> option)
|<A HREF="#/\K">/\K</A>|	\K	\K	like &quot;\k&quot;, but excluding digits
|<A HREF="#/\f">/\f</A>|	\f	\f	file name character (see <A HREF="options.html#'isfname'">'isfname'</A> option)
|<A HREF="#/\F">/\F</A>|	\F	\F	like &quot;\f&quot;, but excluding digits
|<A HREF="#/\p">/\p</A>|	\p	\p	printable character (see <A HREF="options.html#'isprint'">'isprint'</A> option)
|<A HREF="#/\P">/\P</A>|	\P	\P	like &quot;\p&quot;, but excluding digits
|<A HREF="#/\s">/\s</A>|	\s	\s	<A HREF="#whitespace">whitespace</A> character: <A HREF="motion.html#&lt;Space&gt;">&lt;Space&gt;</A> and <A HREF="motion.html#&lt;Tab&gt;">&lt;Tab&gt;</A>
|<A HREF="#/\S">/\S</A>|	\S	\S	non-whitespace character; opposite of \s
|<A HREF="#/\d">/\d</A>|	\d	\d	digit:				[0-9]
|<A HREF="#/\D">/\D</A>|	\D	\D	non-digit:			[^0-9]
|<A HREF="#/\x">/\x</A>|	\x	\x	hex digit:			[0-9A-Fa-f]
|<A HREF="#/\X">/\X</A>|	\X	\X	non-hex digit:			[^0-9A-Fa-f]
|<A HREF="#/\o">/\o</A>|	\o	\o	<A HREF="eval.html#octal">octal</A> digit:			[0-7]
|<A HREF="#/\O">/\O</A>|	\O	\O	non-octal digit:		[^0-7]
|<A HREF="#/\w">/\w</A>|	\w	\w	<A HREF="motion.html#word">word</A> character:			[0-9A-Za-z_]
|<A HREF="#/\W">/\W</A>|	\W	\W	non-word character:		[^0-9A-Za-z_]
|<A HREF="#/\h">/\h</A>|	\h	\h	head of <A HREF="motion.html#word">word</A> character:		[A-Za-z_]
|<A HREF="#/\H">/\H</A>|	\H	\H	non-head of <A HREF="motion.html#word">word</A> character:	[^A-Za-z_]
|<A HREF="#/\a">/\a</A>|	\a	\a	alphabetic character:		[A-Za-z]
|<A HREF="#/\A">/\A</A>|	\A	\A	non-alphabetic character:	[^A-Za-z]
|<A HREF="#/\l">/\l</A>|	\l	\l	<A HREF="change.html#lowercase">lowercase</A> character:		[a-z]
|<A HREF="#/\L">/\L</A>|	\L	\L	non-lowercase character:	[^a-z]
|<A HREF="#/\u">/\u</A>|	\u	\u	<A HREF="change.html#uppercase">uppercase</A> character:		[A-Z]
|<A HREF="#/\U">/\U</A>|	\U	\U	non-uppercase character		[^A-Z]
|<A HREF="#/\_">/\_</A>|	\_x	\_x	where <A HREF="change.html#x">x</A> is any of the characters above: character
			class with end-of-line included
(end of character classes)

<B><FONT COLOR="PURPLE">      magic   nomagic	matches </FONT></B>
|<A HREF="#/\e">/\e</A>|	\e	\e	<A HREF="intro.html#&lt;Esc&gt;">&lt;Esc&gt;</A>
|<A HREF="#/\t">/\t</A>|	\t	\t	<A HREF="motion.html#&lt;Tab&gt;">&lt;Tab&gt;</A>
|<A HREF="#/\r">/\r</A>|	\r	\r	<A HREF="motion.html#&lt;CR&gt;">&lt;CR&gt;</A>
|<A HREF="#/\b">/\b</A>|	\b	\b	<A HREF="motion.html#&lt;BS&gt;">&lt;BS&gt;</A>
|<A HREF="#/\n">/\n</A>|	\n	\n	end-of-line
|<A HREF="#/~">/~</A>|	~	\~	last given substitute <A HREF="eval.html#string">string</A>
|<A HREF="#/\1">/\1</A>|	\1	\1	same <A HREF="eval.html#string">string</A> <A HREF="motion.html#as">as</A> matched by first \(\) {not in Vi}
|<A HREF="#/\2">/\2</A>|	\2	\2	Like &quot;\1&quot;, but uses second \(\)
	   <A HREF="eval.html#...">...</A>
|<A HREF="#/\9">/\9</A>|	\9	\9	Like &quot;\1&quot;, but uses ninth \(\)

								*<A NAME="E68"></A><B>E68</B>*
|<A HREF="syntax.html#/\z1">/\z1</A>|	\z1	\z1	only for <A HREF="syntax.html#syntax">syntax</A> highlighting, see |<A HREF="syntax.html#:syn-ext-match">:syn-ext-match</A>|
	   <A HREF="eval.html#...">...</A>
|<A HREF="syntax.html#/\z1">/\z1</A>|	\z9	\z9	only for <A HREF="syntax.html#syntax">syntax</A> highlighting, see |<A HREF="syntax.html#:syn-ext-match">:syn-ext-match</A>|

	<A HREF="change.html#x">x</A>	<A HREF="change.html#x">x</A>	a character with no special meaning matches itself

|<A HREF="#/[]">/[]</A>|	[]	\[]	any character specified inside the []
|<A HREF="#/\&#37;[]">/\&#37;[]</A>|	\&#37;[]	\&#37;[]	a sequence of optionally matched atoms

|<A HREF="#/\c">/\c</A>|	\c	\c	ignore <A HREF="change.html#case">case</A>, <A HREF="diff.html#do">do</A> not use the <A HREF="options.html#'ignorecase'">'ignorecase'</A> option
|<A HREF="#/\C">/\C</A>|	\C	\C	match <A HREF="change.html#case">case</A>, <A HREF="diff.html#do">do</A> not use the <A HREF="options.html#'ignorecase'">'ignorecase'</A> option
|<A HREF="#/\Z">/\Z</A>|	\Z	\Z	ignore differences in <A HREF="mbyte.html#Unicode">Unicode</A> &quot;combining characters&quot;.
			Useful when searching voweled Hebrew or <A HREF="arabic.html#Arabic">Arabic</A> text.

<B><FONT COLOR="PURPLE">      magic   nomagic	matches </FONT></B>
|<A HREF="#/\m">/\m</A>|	\m	\m	<A HREF="options.html#'magic'">'magic'</A> on for the following chars in the <A HREF="#pattern">pattern</A>
|<A HREF="#/\M">/\M</A>|	\M	\M	<A HREF="options.html#'magic'">'magic'</A> off for the following chars in the <A HREF="#pattern">pattern</A>
|<A HREF="#/\v">/\v</A>|	\v	\v	the following chars in the <A HREF="#pattern">pattern</A> are &quot;very magic&quot;
|<A HREF="#/\V">/\V</A>|	\V	\V	the following chars in the <A HREF="#pattern">pattern</A> are &quot;very nomagic&quot;
|<A HREF="#/\&#37;#=">/\&#37;#=</A>|   \&#37;#=1   \&#37;#=1   select <A HREF="#regexp">regexp</A> engine |<A HREF="#/zero-width">/zero-width</A>|

|<A HREF="#/\&#37;d">/\&#37;d</A>|	\&#37;d	\&#37;d	match specified decimal character (eg \&#37;d123)
|<A HREF="#/\&#37;x">/\&#37;x</A>|	\&#37;x	\&#37;x	match specified hex character (eg \&#37;x2a)
|<A HREF="#/\&#37;o">/\&#37;o</A>|	\&#37;o	\&#37;o	match specified <A HREF="eval.html#octal">octal</A> character (eg \&#37;o040)
|<A HREF="#/\&#37;u">/\&#37;u</A>|	\&#37;u	\&#37;u	match specified <A HREF="mbyte.html#multibyte">multibyte</A> character (eg \&#37;u20ac)
|<A HREF="#/\&#37;U">/\&#37;U</A>|	\&#37;U	\&#37;U	match specified large <A HREF="mbyte.html#multibyte">multibyte</A> character (eg
			\&#37;U12345678)
|<A HREF="#/\&#37;C">/\&#37;C</A>|	\&#37;C	\&#37;C	match any composing characters

<B><FONT COLOR="PURPLE">Example			matches </FONT></B>
\&lt;\I\i*		or
\&lt;\h\w*
\&lt;[a-zA-Z_][a-zA-Z0-9_]*
			An identifier (e.g., in a C program).

\(\.$\|\. \)		A period followed by <A HREF="intro.html#&lt;EOL&gt;">&lt;EOL&gt;</A> or a space.

[.!?][])&quot;']*\($\|[ ]\)	A search <A HREF="#pattern">pattern</A> that finds the end of a <A HREF="motion.html#sentence">sentence</A>,
			with almost the same definition <A HREF="motion.html#as">as</A> the &quot;<A HREF="motion.html#)">)</A>&quot; command.

cat\Z			Both &quot;cat&quot; and &quot;càt&quot; (&quot;a&quot; followed by 0x0300)
			Does not match &quot;càt&quot; (character 0x00e0), even
			though <A HREF="motion.html#it">it</A> may look the same.


==============================================================================

5. Multi items						*<A NAME="pattern-multi-items"></A><B>pattern-multi-items</B>*

An atom can be followed by an indication of how many times the atom can be
matched and in what way.  This is called a multi.  See |<A HREF="#/multi">/multi</A>| for an
overview.


							*<A NAME="/star"></A><B>/star</B>* *<A NAME="/\star"></A><B>/\star</B>*
*	(use \* when <A HREF="options.html#'magic'">'magic'</A> is not set)
	Matches 0 or more of the preceding atom, <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible.
<B><FONT COLOR="PURPLE">	Example  'nomagic'	matches </FONT></B>
	a*	   a\*		&quot;&quot;, &quot;<A HREF="insert.html#a">a</A>&quot;, &quot;aa&quot;, &quot;aaa&quot;, etc.
	.*	   \.\*		anything, also an empty <A HREF="eval.html#string">string</A>, no end-of-line
	\_.*	   \_.\*	everything up to the end of the buffer
	\_.*END	   \_.\*END	everything up to and including the last &quot;END&quot;
				in the buffer

	Exception: When &quot;*&quot; is used at the start of the <A HREF="#pattern">pattern</A> or just after
	&quot;<A HREF="motion.html#^">^</A>&quot; <A HREF="motion.html#it">it</A> matches the <A HREF="#star">star</A> character.

	Be aware that <A HREF="repeat.html#repeating">repeating</A> &quot;\_.&quot; can match a lot of text and take a long
	time.  For example, &quot;\_.*END&quot; matches all text from the current
	position to the last occurrence of &quot;END&quot; in the file.  Since the &quot;*&quot;
	will match <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible, this first skips over all lines until
	the end of the file and then tries matching &quot;END&quot;, backing up one
	character at a time.


							*<A NAME="/\+"></A><B>/\+</B>*
\+	Matches 1 or more of the preceding atom, <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible. {not in
	Vi}
<B><FONT COLOR="PURPLE">	Example		matches </FONT></B>
	^.\+$		any non-empty line
	\s\+		white space of at least one character


							*<A NAME="/\="></A><B>/\=</B>*
\=	Matches 0 or 1 of the preceding atom, <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible. {not in Vi}
<B><FONT COLOR="PURPLE">	Example		matches </FONT></B>
	foo\=		&quot;fo&quot; and &quot;foo&quot;


							*<A NAME="/\?"></A><B>/\?</B>*
\?	Just like \=.  Cannot be used when searching backwards with the &quot;<A HREF="#?">?</A>&quot;
	command. {not in Vi}


					*<A NAME="/\{"></A><B>/\{</B>* *<A NAME="E60"></A><B>E60</B>* *<A NAME="E554"></A><B>E554</B>* *<A NAME="E870"></A><B>E870</B>*
\{n,m}	Matches <A HREF="#n">n</A> to <A HREF="motion.html#m">m</A> of the preceding atom, <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible
\{n}	Matches <A HREF="#n">n</A> of the preceding atom
\{n,}	Matches at least <A HREF="#n">n</A> of the preceding atom, <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible
\{,m}	Matches 0 to <A HREF="motion.html#m">m</A> of the preceding atom, <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible
\{}	Matches 0 or more of the preceding atom, <A HREF="motion.html#as">as</A> many <A HREF="motion.html#as">as</A> possible (like *)

							*<A NAME="/\{-"></A><B>/\{-</B>*
\{-n,m}	matches <A HREF="#n">n</A> to <A HREF="motion.html#m">m</A> of the preceding atom, <A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible
\{-n}	matches <A HREF="#n">n</A> of the preceding atom
\{-n,}	matches at least <A HREF="#n">n</A> of the preceding atom, <A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible
\{-,m}	matches 0 to <A HREF="motion.html#m">m</A> of the preceding atom, <A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible
\{-}	matches 0 or more of the preceding atom, <A HREF="motion.html#as">as</A> few <A HREF="motion.html#as">as</A> possible
	{Vi does not have any of these}

	<A HREF="#n">n</A> and <A HREF="motion.html#m">m</A> are positive decimal numbers or zero

								*<A NAME="non-greedy"></A><B>non-greedy</B>*
	If a &quot;<A HREF="motion.html#-">-</A>&quot; appears immediately after the &quot;<A HREF="motion.html#{">{</A>&quot;, then a shortest match
	first algorithm is used (see example below).  In particular, &quot;\{-}&quot; is
	the same <A HREF="motion.html#as">as</A> &quot;*&quot; but uses the shortest match first algorithm.  BUT: A
	match that starts earlier is preferred over a shorter match: &quot;a\{-}b&quot;
	matches &quot;aaab&quot; in &quot;xaaab&quot;.

<B><FONT COLOR="PURPLE">	Example			matches </FONT></B>
	ab\{2,3}c		&quot;abbc&quot; or &quot;abbbc&quot;
	a\{5}			&quot;aaaaa&quot;
	ab\{2,}c		&quot;abbc&quot;, &quot;abbbc&quot;, &quot;abbbbc&quot;, etc.
	ab\{,3}c		&quot;ac&quot;, &quot;abc&quot;, &quot;abbc&quot; or &quot;abbbc&quot;
	a[bc]\{3}d		&quot;abbbd&quot;, &quot;abbcd&quot;, &quot;acbcd&quot;, &quot;acccd&quot;, etc.
	a\(bc\)\{1,2}d		&quot;abcd&quot; or &quot;abcbcd&quot;
	a[bc]\{-}[cd]		&quot;abc&quot; in &quot;abcd&quot;
	a[bc]*[cd]		&quot;abcd&quot; in &quot;abcd&quot;

	The } may optionally be preceded with a <A HREF="intro.html#backslash">backslash</A>: \{n,m\}.


							*<A NAME="/\@="></A><B>/\@=</B>*
\@=	Matches the preceding atom with zero width. {not in Vi}
	Like &quot;(?=pattern)&quot; in <A HREF="if_perl.html#Perl">Perl</A>.
<B><FONT COLOR="PURPLE">	Example			matches </FONT></B>
	foo\(bar\)\@=		&quot;foo&quot; in &quot;foobar&quot;
	foo\(bar\)\@=foo	nothing

							*<A NAME="/zero-width"></A><B>/zero-width</B>*
	When using &quot;\@=&quot; (or &quot;<A HREF="motion.html#^">^</A>&quot;, &quot;<A HREF="motion.html#$">$</A>&quot;, &quot;\&lt;&quot;, &quot;\&gt;&quot;) no characters are included
	in the match.  These items are only used to check if a match can be
	made.  This can be tricky, because a match with following items will
	be done in the same position.  The last example above will not match
	&quot;foobarfoo&quot;, because <A HREF="motion.html#it">it</A> tries match &quot;foo&quot; in the same position where
	&quot;<A HREF="motion.html#bar">bar</A>&quot; matched.

	Note that using &quot;\&amp;&quot; works the same <A HREF="motion.html#as">as</A> using &quot;\@=&quot;: &quot;foo\&amp;..&quot; is the
	same <A HREF="motion.html#as">as</A> &quot;\(foo\)\@=..&quot;.  But using &quot;\&amp;&quot; is easier, you don't need the
	braces.



							*<A NAME="/\@!"></A><B>/\@!</B>*
\@!	Matches with zero width if the preceding atom does NOT match at the
	current position. |<A HREF="#/zero-width">/zero-width</A>| {not in Vi}
	Like &quot;(?!pattern)&quot; in <A HREF="if_perl.html#Perl">Perl</A>.
<B><FONT COLOR="PURPLE">	Example			matches </FONT></B>
	foo\(bar\)\@!		any &quot;foo&quot; not followed by &quot;<A HREF="motion.html#bar">bar</A>&quot;
	a.\{-}p\@!		&quot;<A HREF="insert.html#a">a</A>&quot;, &quot;<A HREF="motion.html#ap">ap</A>&quot;, &quot;app&quot;, &quot;appp&quot;, etc. not immediately
				followed by a &quot;<A HREF="change.html#p">p</A>&quot;
	if \(\(then\)\@!.\)*$	&quot;if &quot; not followed by &quot;then&quot;

	Using &quot;\@!&quot; is tricky, because there are many places where a <A HREF="#pattern">pattern</A>
	does not match.  &quot;a.*p\@!&quot; will match from an &quot;<A HREF="insert.html#a">a</A>&quot; to the end of the
	line, because &quot;.*&quot; can match all characters in the line and the &quot;<A HREF="change.html#p">p</A>&quot;
	doesn't match at the end of the line.  &quot;a.\{-}p\@!&quot; will match any
	&quot;<A HREF="insert.html#a">a</A>&quot;, &quot;<A HREF="motion.html#ap">ap</A>&quot;, &quot;app&quot;, etc. that isn't followed by a &quot;<A HREF="change.html#p">p</A>&quot;, because the &quot;<A HREF="repeat.html#.">.</A>&quot;
	can match a &quot;<A HREF="change.html#p">p</A>&quot; and &quot;p\@!&quot; doesn't match after that.

	You can't use &quot;\@!&quot; to look for a non-match before the matching
	position: &quot;\(foo\)\@!bar&quot; will match &quot;<A HREF="motion.html#bar">bar</A>&quot; in &quot;foobar&quot;, because at the
	position where &quot;<A HREF="motion.html#bar">bar</A>&quot; matches, &quot;foo&quot; does not match.  To avoid matching
	&quot;foobar&quot; you could use &quot;\(foo\)\@!...bar&quot;, but that doesn't match a
	<A HREF="motion.html#bar">bar</A> at the start of a line.  Use &quot;\(foo\)\@&lt;!bar&quot;.

	Useful example: to find &quot;foo&quot; in a line that does not contain &quot;<A HREF="motion.html#bar">bar</A>&quot;:
<B>		/^\%(.*bar\)\@!.*\zsfoo</B>
 	This <A HREF="#pattern">pattern</A> first checks that there is not a single position in the
	line where &quot;<A HREF="motion.html#bar">bar</A>&quot; matches.  If &quot;.*bar&quot; matches somewhere the \@! will
	reject the <A HREF="#pattern">pattern</A>.  When there is no match any &quot;foo&quot; will be found.
	The &quot;\zs&quot; is to have the match start just before &quot;foo&quot;.


							*<A NAME="/\@&lt;="></A><B>/\@&lt;=</B>*
\@&lt;=	Matches with zero width if the preceding atom matches just before what
	follows. |<A HREF="#/zero-width">/zero-width</A>| {not in Vi}
	Like &quot;(?&lt;=pattern)&quot; in <A HREF="if_perl.html#Perl">Perl</A>, but Vim allows non-fixed-width patterns.
<B><FONT COLOR="PURPLE">	Example			matches </FONT></B>
	\(an\_s\+\)\@&lt;=file	&quot;file&quot; after &quot;an&quot; and white space or an
				end-of-line
	For speed it's often much better to avoid this multi.  Try using &quot;\zs&quot;
	instead |<A HREF="#/\zs">/\zs</A>|.  To match the same <A HREF="motion.html#as">as</A> the above example:
		an\_s\+\zsfile
	At least set a limit for the look-behind, see below.

	&quot;\@&lt;=&quot; and &quot;\@&lt;!&quot; check for matches just before what follows.
	Theoretically these matches could start anywhere before this position.
	But to limit the time needed, only the line where what follows matches
	is searched, and one line before that (if there is one).  This should
	be sufficient to match most things and not be too slow.

	In the old <A HREF="#regexp">regexp</A> engine the part of the <A HREF="#pattern">pattern</A> after &quot;\@&lt;=&quot; and
	&quot;\@&lt;!&quot; are checked for a match first, thus things like &quot;\1&quot; don't work
	to reference \(\) inside the preceding atom.  It does work the other
	way around:
<B><FONT COLOR="PURPLE">	Bad example			matches </FONT></B>
	\&#37;#=1\1\@&lt;=,\([a-z]\+\)		&quot;,abc&quot; in &quot;abc,abc&quot;

	However, the new <A HREF="#regexp">regexp</A> engine works differently, <A HREF="motion.html#it">it</A> is better to not
	rely on this behavior, <A HREF="diff.html#do">do</A> not use \@&lt;= if <A HREF="motion.html#it">it</A> can be avoided:
<B><FONT COLOR="PURPLE">	Example				matches </FONT></B>
	\([a-z]\+\)\zs,\1		&quot;,abc&quot; in &quot;abc,abc&quot;

\@123&lt;=
	Like &quot;\@&lt;=&quot; but only look back 123 bytes. This avoids trying lots
	of matches that are known to fail and make executing the <A HREF="#pattern">pattern</A> very
	slow.  Example, check if there is a &quot;<A HREF="change.html#&lt;">&lt;</A>&quot; just before &quot;span&quot;:
		/&lt;\@1&lt;=span
	This will try matching &quot;<A HREF="change.html#&lt;">&lt;</A>&quot; only one byte before &quot;span&quot;, which is the
	only place that works anyway.
	After crossing a line boundary, the limit is relative to the end of
	the line.  Thus the characters at the start of the line with the match
	are not counted (this is just to keep <A HREF="motion.html#it">it</A> simple).
	The number zero is the same <A HREF="motion.html#as">as</A> no limit.


							*<A NAME="/\@&lt;!"></A><B>/\@&lt;!</B>*
\@&lt;!	Matches with zero width if the preceding atom does NOT match just
	before what follows.  Thus this matches if there is no position in the
	current or previous line where the atom matches such that <A HREF="motion.html#it">it</A> ends just
	before what follows.  |<A HREF="#/zero-width">/zero-width</A>| {not in Vi}
	Like &quot;(?&lt;!pattern)&quot; in <A HREF="if_perl.html#Perl">Perl</A>, but Vim allows non-fixed-width patterns.
	The match with the preceding atom is made to end just before the match
	with what follows, thus an atom that ends in &quot;.*&quot; will work.
	Warning: This can be slow (because many positions need to be checked
	for a match).  Use a limit if you can, see below.
<B><FONT COLOR="PURPLE">	Example			matches </FONT></B>
	\(foo\)\@&lt;!bar		any &quot;<A HREF="motion.html#bar">bar</A>&quot; that's not in &quot;foobar&quot;
	\(\/\/.*\)\@&lt;!in	&quot;in&quot; which is not after &quot;<A HREF="version7.html#//">//</A>&quot;

\@123&lt;!
	Like &quot;\@&lt;!&quot; but only look back 123 bytes. This avoids trying lots of
	matches that are known to fail and make executing the <A HREF="#pattern">pattern</A> very
	slow.


							*<A NAME="/\@&gt;"></A><B>/\@&gt;</B>*
\@&gt;	Matches the preceding atom like matching a whole <A HREF="#pattern">pattern</A>. {not in Vi}
	Like &quot;(?&gt;pattern)&quot; in <A HREF="if_perl.html#Perl">Perl</A>.
<B><FONT COLOR="PURPLE">	Example		matches </FONT></B>
	\(a*\)\@&gt;a	nothing (the &quot;a*&quot; takes all the &quot;a&quot;'s, there can't be
			another one following)

	This matches the preceding atom <A HREF="motion.html#as">as</A> if <A HREF="motion.html#it">it</A> was a <A HREF="#pattern">pattern</A> by itself.  If
	<A HREF="motion.html#it">it</A> doesn't match, there is no retry with shorter sub-matches or
	anything.  Observe this difference: &quot;a*b&quot; and &quot;a*ab&quot; both match
	&quot;aaab&quot;, but in the second <A HREF="change.html#case">case</A> the &quot;a*&quot; matches only the first two
	&quot;a&quot;s.  &quot;\(a*\)\@&gt;ab&quot; will not match &quot;aaab&quot;, because the &quot;a*&quot; matches
	the &quot;aaa&quot; (as many &quot;<A HREF="insert.html#a">a</A>&quot;s <A HREF="motion.html#as">as</A> possible), thus the &quot;<A HREF="motion.html#ab">ab</A>&quot; can't match.


==============================================================================

6.  Ordinary atoms					*<A NAME="pattern-atoms"></A><B>pattern-atoms</B>*

An ordinary atom can be:


							*<A NAME="/^"></A><B>/^</B>*
^	At beginning of <A HREF="#pattern">pattern</A> or after &quot;\|&quot;, &quot;\(&quot;, &quot;\&#37;(&quot; or &quot;\n&quot;: matches
	start-of-line; at other positions, matches literal '<A HREF="motion.html#^">^</A>'. |<A HREF="#/zero-width">/zero-width</A>|
<B><FONT COLOR="PURPLE">	Example		matches </FONT></B>
	^beep(		the start of the C function &quot;beep&quot; (probably).


							*<A NAME="/\^"></A><B>/\^</B>*
\^	Matches literal '<A HREF="motion.html#^">^</A>'.  Can be used at any position in the <A HREF="#pattern">pattern</A>.


							*<A NAME="/\_^"></A><B>/\_^</B>*
\_^	Matches start-of-line. |<A HREF="#/zero-width">/zero-width</A>|  Can be used at any position in
	the <A HREF="#pattern">pattern</A>.
<B><FONT COLOR="PURPLE">	Example		matches </FONT></B>
	\_s*\_^foo	white space and blank lines and then &quot;foo&quot; at
			start-of-line


							*<A NAME="/$"></A><B>/$</B>*
$	At end of <A HREF="#pattern">pattern</A> or in front of &quot;\|&quot;, &quot;\)&quot; or &quot;\n&quot; ('magic' on):
	matches end-of-line <A HREF="intro.html#&lt;EOL&gt;">&lt;EOL&gt;</A>; at other positions, matches literal '<A HREF="motion.html#$">$</A>'.
	|<A HREF="#/zero-width">/zero-width</A>|


							*<A NAME="/\$"></A><B>/\$</B>*
\$	Matches literal '<A HREF="motion.html#$">$</A>'.  Can be used at any position in the <A HREF="#pattern">pattern</A>.


							*<A NAME="/\_$"></A><B>/\_$</B>*
\_$	Matches end-of-line. |<A HREF="#/zero-width">/zero-width</A>|  Can be used at any position in the
	<A HREF="#pattern">pattern</A>.  Note that &quot;a\_$b&quot; never matches, since &quot;<A HREF="motion.html#b">b</A>&quot; cannot match an
	end-of-line.  Use &quot;a\nb&quot; instead |<A HREF="#/\n">/\n</A>|.
<B><FONT COLOR="PURPLE">	Example		matches </FONT></B>
	foo\_$\_s*	&quot;foo&quot; at end-of-line and following white space and
			blank lines


.	(with <A HREF="options.html#'nomagic'">'nomagic'</A>: \.)				*<A NAME="/."></A><B>/.</B>* *<A NAME="/\."></A><B>/\.</B>*
	Matches any single character, but not an end-of-line.


							*<A NAME="/\_."></A><B>/\_.</B>*
\_.	Matches any single character or end-of-line.
	Careful: &quot;\_.*&quot; matches all text to the end of the buffer!


							*<A NAME="/\&lt;"></A><B>/\&lt;</B>*
\&lt;	Matches the beginning of a <A HREF="motion.html#word">word</A>: The next char is the first char of a
	<A HREF="motion.html#word">word</A>.  The <A HREF="options.html#'iskeyword'">'iskeyword'</A> option specifies what is a <A HREF="motion.html#word">word</A> character.
	|<A HREF="#/zero-width">/zero-width</A>|


							*<A NAME="/\&gt;"></A><B>/\&gt;</B>*
\&gt;	Matches the end of a <A HREF="motion.html#word">word</A>: The previous char is the last char of a
	<A HREF="motion.html#word">word</A>.  The <A HREF="options.html#'iskeyword'">'iskeyword'</A> option specifies what is a <A HREF="motion.html#word">word</A> character.
	|<A HREF="#/zero-width">/zero-width</A>|


							*<A NAME="/\zs"></A><B>/\zs</B>*
\zs	Matches at any position, and sets the start of the match there: The
	next char is the first char of the whole match. |<A HREF="#/zero-width">/zero-width</A>|
	Example:
<B>		/^\s*\zsif</B>
 	matches an &quot;if&quot; at the start of a line, ignoring white space.
	Can be used multiple times, the last one encountered in a matching
	branch is used.  Example:
<B>		/\(.\{-}\zsFab\)\{3}</B>
 	Finds the third occurrence of &quot;Fab&quot;.

	This cannot be followed by a multi. *<A NAME="E888"></A><B>E888</B>*
	{not in Vi} {not available when compiled without the |<A HREF="various.html#+syntax">+syntax</A>| feature}

							*<A NAME="/\ze"></A><B>/\ze</B>*
\ze	Matches at any position, and sets the end of the match there: The
	previous char is the last char of the whole match. |<A HREF="#/zero-width">/zero-width</A>|
	Can be used multiple times, the last one encountered in a matching
	branch is used.
	Example: &quot;end\ze\(if\|for\)&quot; matches the &quot;end&quot; in &quot;endif&quot; and
	&quot;endfor&quot;.
	This cannot be followed by a multi. |<A HREF="#E888">E888</A>|
	{not in Vi} {not available when compiled without the |<A HREF="various.html#+syntax">+syntax</A>| feature}


						*<A NAME="/\&#37;^"></A><B>/\&#37;^</B>* *<A NAME="start-of-file"></A><B>start-of-file</B>*
\&#37;^	Matches start of the file.  When matching with a <A HREF="eval.html#string">string</A>, matches the
	start of the <A HREF="eval.html#string">string</A>. {not in Vi}
	For example, to find the first &quot;VIM&quot; in a file:
<B>		/\%^\_.\{-}\zsVIM</B>
 

						*<A NAME="/\&#37;$"></A><B>/\&#37;$</B>* *<A NAME="end-of-file"></A><B>end-of-file</B>*
\&#37;$	Matches end of the file.  When matching with a <A HREF="eval.html#string">string</A>, matches the
	end of the <A HREF="eval.html#string">string</A>. {not in Vi}
	Note that this does NOT find the last &quot;VIM&quot; in a file:
<B>		/VIM\_.\{-}\%$</B>
 	It will find the next VIM, because the part after <A HREF="motion.html#it">it</A> will always
	match.  This one will find the last &quot;VIM&quot; in the file:
<B>		/VIM\ze\(\(VIM\)\@!\_.\)*\%$</B>
 	This uses |<A HREF="#/\@!">/\@!</A>| to ascertain that &quot;VIM&quot; does NOT match in any
	position after the first &quot;VIM&quot;.
	Searching from the end of the file backwards is easier!


						*<A NAME="/\&#37;V"></A><B>/\&#37;V</B>*
\&#37;V	Match inside the <A HREF="visual.html#Visual">Visual</A> area.  When <A HREF="visual.html#Visual">Visual</A> mode has already been
	stopped match in the area that |<A HREF="visual.html#gv">gv</A>| would reselect.
	This is a |<A HREF="#/zero-width">/zero-width</A>| match.  To make sure the whole <A HREF="#pattern">pattern</A> is
	inside the <A HREF="visual.html#Visual">Visual</A> area put <A HREF="motion.html#it">it</A> at the start and just before the end of
	the <A HREF="#pattern">pattern</A>, e.g.:
<B>		/\%Vfoo.*ba\%Vr</B>
 	This also works if only &quot;foo bar&quot; was Visually selected. This:
<B>		/\%Vfoo.*bar\%V</B>
 	would match &quot;foo bar&quot; if the <A HREF="visual.html#Visual">Visual</A> selection continues after the &quot;<A HREF="change.html#r">r</A>&quot;.
	Only works for the current buffer.


						*<A NAME="/\&#37;#"></A><B>/\&#37;#</B>* *<A NAME="cursor-position"></A><B>cursor-position</B>*
\&#37;#	Matches with the cursor position.  Only works when matching in a
	buffer displayed in a <A HREF="windows.html#window">window</A>. {not in Vi}
	WARNING: When the cursor is moved after the <A HREF="#pattern">pattern</A> was used, the
	result becomes invalid.  Vim doesn't automatically update the matches.
	This is especially relevant for <A HREF="syntax.html#syntax">syntax</A> highlighting and <A HREF="options.html#'hlsearch'">'hlsearch'</A>.
	In other words: When the cursor moves the display isn't updated for
	this change.  An update is done for lines which are changed (the whole
	line is updated) or when using the |<A HREF="various.html#CTRL-L">CTRL-L</A>| command (the whole screen
	is updated).  Example, to highlight the <A HREF="motion.html#word">word</A> under the cursor:
<B>		/\k*\%#\k*</B>
 	When <A HREF="options.html#'hlsearch'">'hlsearch'</A> is set and you move the cursor around and make changes
	this will clearly show when the match is updated or not.


						*<A NAME="/\&#37;'m"></A><B>/\&#37;'m</B>* *<A NAME="/\&#37;&lt;'m"></A><B>/\&#37;&lt;'m</B>* *<A NAME="/\&#37;&gt;'m"></A><B>/\&#37;&gt;'m</B>*
\&#37;'m	Matches with the position of <A HREF="motion.html#mark">mark</A> <A HREF="motion.html#m">m</A>.
\&#37;&lt;'m	Matches before the position of <A HREF="motion.html#mark">mark</A> <A HREF="motion.html#m">m</A>.
\&#37;&gt;'m	Matches after the position of <A HREF="motion.html#mark">mark</A> <A HREF="motion.html#m">m</A>.
	Example, to highlight the text from <A HREF="motion.html#mark">mark</A> 's to 'e:
<B>		/.\%&gt;'s.*\%&lt;'e..</B>
 	Note that two dots are required to include <A HREF="motion.html#mark">mark</A> 'e in the match.  That
	is because &quot;\&#37;&lt;'e&quot; matches at the character before the 'e <A HREF="motion.html#mark">mark</A>, and
	since it's a |<A HREF="#/zero-width">/zero-width</A>| match <A HREF="motion.html#it">it</A> doesn't include that character.
	{not in Vi}
	WARNING: When the <A HREF="motion.html#mark">mark</A> is moved after the <A HREF="#pattern">pattern</A> was used, the result
	becomes invalid.  Vim doesn't automatically update the matches.
	Similar to moving the cursor for &quot;\&#37;#&quot; |<A HREF="#/\&#37;#">/\&#37;#</A>|.


						*<A NAME="/\&#37;l"></A><B>/\&#37;l</B>* *<A NAME="/\&#37;&gt;l"></A><B>/\&#37;&gt;l</B>* *<A NAME="/\&#37;&lt;l"></A><B>/\&#37;&lt;l</B>*
\&#37;23l	Matches in a specific line.
\&#37;&lt;23l	Matches above a specific line (lower line number).
\&#37;&gt;23l	Matches below a specific line (higher line number).
	These three can be used to match specific lines in a buffer.  The &quot;23&quot;
	can be any line number.  The first line is 1. {not in Vi}
	WARNING: When <A HREF="insert.html#inserting">inserting</A> or <A HREF="change.html#deleting">deleting</A> lines Vim does not automatically
	update the matches.  This means <A HREF="autocmd.html#Syntax">Syntax</A> highlighting quickly becomes
	wrong.
	Example, to highlight the line where the cursor currently is:
<B>		:exe '/\%' . line(".") . 'l.*'</B>
 	When <A HREF="options.html#'hlsearch'">'hlsearch'</A> is set and you move the cursor around and make changes
	this will clearly show when the match is updated or not.


						*<A NAME="/\&#37;c"></A><B>/\&#37;c</B>* *<A NAME="/\&#37;&gt;c"></A><B>/\&#37;&gt;c</B>* *<A NAME="/\&#37;&lt;c"></A><B>/\&#37;&lt;c</B>*
\&#37;23c	Matches in a specific column.
\&#37;&lt;23c	Matches before a specific column.
\&#37;&gt;23c	Matches after a specific column.
	These three can be used to match specific columns in a buffer or
	<A HREF="eval.html#string">string</A>.  The &quot;23&quot; can be any column number.  The first column is 1.
	Actually, the column is the byte number (thus it's not exactly right
	for <A HREF="mbyte.html#multi-byte">multi-byte</A> characters).  {not in Vi}
	WARNING: When <A HREF="insert.html#inserting">inserting</A> or <A HREF="change.html#deleting">deleting</A> text Vim does not automatically
	update the matches.  This means <A HREF="autocmd.html#Syntax">Syntax</A> highlighting quickly becomes
	wrong.
	Example, to highlight the column where the cursor currently is:
<B>		:exe '/\%' . col(".") . 'c'</B>
 	When <A HREF="options.html#'hlsearch'">'hlsearch'</A> is set and you move the cursor around and make changes
	this will clearly show when the match is updated or not.
	Example for matching a single byte in column 44:
<B>		/\%&gt;43c.\%&lt;46c</B>
 	Note that &quot;\&#37;&lt;46c&quot; matches in column 45 when the &quot;<A HREF="repeat.html#.">.</A>&quot; matches a byte in
	column 44.

						*<A NAME="/\&#37;v"></A><B>/\&#37;v</B>* *<A NAME="/\&#37;&gt;v"></A><B>/\&#37;&gt;v</B>* *<A NAME="/\&#37;&lt;v"></A><B>/\&#37;&lt;v</B>*
\&#37;23v	Matches in a specific virtual column.
\&#37;&lt;23v	Matches before a specific virtual column.
\&#37;&gt;23v	Matches after a specific virtual column.
	These three can be used to match specific virtual columns in a buffer
	or <A HREF="eval.html#string">string</A>.  When not matching with a buffer in a <A HREF="windows.html#window">window</A>, the option
	values of the current <A HREF="windows.html#window">window</A> are used (e.g., <A HREF="options.html#'tabstop'">'tabstop'</A>).
	The &quot;23&quot; can be any column number.  The first column is 1.
	Note that some virtual column positions will never match, because they
	are halfway through a <A HREF="intro.html#tab">tab</A> or other character that occupies more than
	one screen character.  {not in Vi}
	WARNING: When <A HREF="insert.html#inserting">inserting</A> or <A HREF="change.html#deleting">deleting</A> text Vim does not automatically
	update highlighted matches.  This means <A HREF="autocmd.html#Syntax">Syntax</A> highlighting quickly
	becomes wrong.
	Example, to highlight all the characters after virtual column 72:
<B>		/\%&gt;72v.*</B>
 	When <A HREF="options.html#'hlsearch'">'hlsearch'</A> is set and you move the cursor around and make changes
	this will clearly show when the match is updated or not.
	To match the text up to column 17:
<B>		/^.*\%17v</B>
 	Column 17 is not included, because this is a |<A HREF="#/zero-width">/zero-width</A>| match. To
	include the column use:
<B>		/^.*\%17v.</B>
 	This command does the same thing, but also matches when there is no
	character in column 17:
<B>		/^.*\%&lt;18v.</B>
 	Note that without the &quot;<A HREF="motion.html#^">^</A>&quot; to anchor the match in the first column,
	this will also highlight column 17:
<B>		/.*\%17v</B>
 	Column 17 is highlighted by <A HREF="options.html#'hlsearch'">'hlsearch'</A> because there is another match
	where &quot;.*&quot; matches zero characters.
<A HREF="change.html#&lt;">&lt;</A>

Character classes: {not in Vi}

\i	identifier character (see <A HREF="options.html#'isident'">'isident'</A> option)	*<A NAME="/\i"></A><B>/\i</B>*

\I	like &quot;\i&quot;, but excluding digits			*<A NAME="/\I"></A><B>/\I</B>*

\k	keyword character (see <A HREF="options.html#'iskeyword'">'iskeyword'</A> option)	*<A NAME="/\k"></A><B>/\k</B>*

\K	like &quot;\k&quot;, but excluding digits			*<A NAME="/\K"></A><B>/\K</B>*

\f	file name character (see <A HREF="options.html#'isfname'">'isfname'</A> option)	*<A NAME="/\f"></A><B>/\f</B>*

\F	like &quot;\f&quot;, but excluding digits			*<A NAME="/\F"></A><B>/\F</B>*

\p	printable character (see <A HREF="options.html#'isprint'">'isprint'</A> option)	*<A NAME="/\p"></A><B>/\p</B>*

\P	like &quot;\p&quot;, but excluding digits			*<A NAME="/\P"></A><B>/\P</B>*

NOTE: the above also work for <A HREF="mbyte.html#multi-byte">multi-byte</A> characters.  The ones below only
match ASCII characters, <A HREF="motion.html#as">as</A> indicated by the range.


						*<A NAME="whitespace"></A><B>whitespace</B>* *<A NAME="white-space"></A><B>white-space</B>*

\s	<A HREF="#whitespace">whitespace</A> character: <A HREF="motion.html#&lt;Space&gt;">&lt;Space&gt;</A> and <A HREF="motion.html#&lt;Tab&gt;">&lt;Tab&gt;</A>		*<A NAME="/\s"></A><B>/\s</B>*

\S	non-whitespace character; opposite of \s	*<A NAME="/\S"></A><B>/\S</B>*

\d	digit:				[0-9]		*<A NAME="/\d"></A><B>/\d</B>*

\D	non-digit:			[^0-9]		*<A NAME="/\D"></A><B>/\D</B>*

\x	hex digit:			[0-9A-Fa-f]	*<A NAME="/\x"></A><B>/\x</B>*

\X	non-hex digit:			[^0-9A-Fa-f]	*<A NAME="/\X"></A><B>/\X</B>*

\o	<A HREF="eval.html#octal">octal</A> digit:			[0-7]		*<A NAME="/\o"></A><B>/\o</B>*

\O	non-octal digit:		[^0-7]		*<A NAME="/\O"></A><B>/\O</B>*

\w	<A HREF="motion.html#word">word</A> character:			[0-9A-Za-z_]	*<A NAME="/\w"></A><B>/\w</B>*

\W	non-word character:		[^0-9A-Za-z_]	*<A NAME="/\W"></A><B>/\W</B>*

\h	head of <A HREF="motion.html#word">word</A> character:		[A-Za-z_]	*<A NAME="/\h"></A><B>/\h</B>*

\H	non-head of <A HREF="motion.html#word">word</A> character:	[^A-Za-z_]	*<A NAME="/\H"></A><B>/\H</B>*

\a	alphabetic character:		[A-Za-z]	*<A NAME="/\a"></A><B>/\a</B>*

\A	non-alphabetic character:	[^A-Za-z]	*<A NAME="/\A"></A><B>/\A</B>*

\l	<A HREF="change.html#lowercase">lowercase</A> character:		[a-z]		*<A NAME="/\l"></A><B>/\l</B>*

\L	non-lowercase character:	[^a-z]		*<A NAME="/\L"></A><B>/\L</B>*

\u	<A HREF="change.html#uppercase">uppercase</A> character:		[A-Z]		*<A NAME="/\u"></A><B>/\u</B>*

\U	non-uppercase character:	[^A-Z]		*<A NAME="/\U"></A><B>/\U</B>*

	NOTE: Using the atom is faster than the <A HREF="motion.html#[]">[]</A> form.

	NOTE: <A HREF="options.html#'ignorecase'">'ignorecase'</A>, &quot;\c&quot; and &quot;\C&quot; are not used by character classes.


			*<A NAME="/\_"></A><B>/\_</B>* *<A NAME="E63"></A><B>E63</B>* *<A NAME="/\_i"></A><B>/\_i</B>* *<A NAME="/\_I"></A><B>/\_I</B>* *<A NAME="/\_k"></A><B>/\_k</B>* *<A NAME="/\_K"></A><B>/\_K</B>* *<A NAME="/\_f"></A><B>/\_f</B>* *<A NAME="/\_F"></A><B>/\_F</B>*

			*<A NAME="/\_p"></A><B>/\_p</B>* *<A NAME="/\_P"></A><B>/\_P</B>* *<A NAME="/\_s"></A><B>/\_s</B>* *<A NAME="/\_S"></A><B>/\_S</B>* *<A NAME="/\_d"></A><B>/\_d</B>* *<A NAME="/\_D"></A><B>/\_D</B>* *<A NAME="/\_x"></A><B>/\_x</B>* *<A NAME="/\_X"></A><B>/\_X</B>*

			*<A NAME="/\_o"></A><B>/\_o</B>* *<A NAME="/\_O"></A><B>/\_O</B>* *<A NAME="/\_w"></A><B>/\_w</B>* *<A NAME="/\_W"></A><B>/\_W</B>* *<A NAME="/\_h"></A><B>/\_h</B>* *<A NAME="/\_H"></A><B>/\_H</B>* *<A NAME="/\_a"></A><B>/\_a</B>* *<A NAME="/\_A"></A><B>/\_A</B>*

			*<A NAME="/\_l"></A><B>/\_l</B>* *<A NAME="/\_L"></A><B>/\_L</B>* *<A NAME="/\_u"></A><B>/\_u</B>* *<A NAME="/\_U"></A><B>/\_U</B>*
\_x	Where &quot;<A HREF="change.html#x">x</A>&quot; is any of the characters above: The character class with
	end-of-line added
(end of character classes)


\e	matches <A HREF="intro.html#&lt;Esc&gt;">&lt;Esc&gt;</A>					*<A NAME="/\e"></A><B>/\e</B>*

\t	matches <A HREF="motion.html#&lt;Tab&gt;">&lt;Tab&gt;</A>					*<A NAME="/\t"></A><B>/\t</B>*

\r	matches <A HREF="motion.html#&lt;CR&gt;">&lt;CR&gt;</A>					*<A NAME="/\r"></A><B>/\r</B>*

\b	matches <A HREF="motion.html#&lt;BS&gt;">&lt;BS&gt;</A>					*<A NAME="/\b"></A><B>/\b</B>*

\n	matches an end-of-line				*<A NAME="/\n"></A><B>/\n</B>*
	When matching in a <A HREF="eval.html#string">string</A> instead of buffer text a literal newline
	character is matched.


~	matches the last given substitute <A HREF="eval.html#string">string</A>	*<A NAME="/~"></A><B>/~</B>* *<A NAME="/\~"></A><B>/\~</B>*


\(\)	A <A HREF="#pattern">pattern</A> enclosed by escaped parentheses.	*<A NAME="/\("></A><B>/\(</B>* *<A NAME="/\(\)"></A><B>/\(\)</B>* *<A NAME="/\)"></A><B>/\)</B>*
	E.g., &quot;\(^a\)&quot; matches '<A HREF="insert.html#a">a</A>' at the start of a line.

	*<A NAME="E51"></A><B>E51</B>* *<A NAME="E54"></A><B>E54</B>* *<A NAME="E55"></A><B>E55</B>* *<A NAME="E872"></A><B>E872</B>* *<A NAME="E873"></A><B>E873</B>*


\1      Matches the same <A HREF="eval.html#string">string</A> that was matched by	*<A NAME="/\1"></A><B>/\1</B>* *<A NAME="E65"></A><B>E65</B>*
	the first sub-expression in \( and \). {not in Vi}
	Example: &quot;\([a-z]\).\1&quot; matches &quot;ata&quot;, &quot;ehe&quot;, &quot;tot&quot;, etc.

\2      Like &quot;\1&quot;, but uses second sub-expression,	*<A NAME="/\2"></A><B>/\2</B>*

   <A HREF="eval.html#...">...</A>							*<A NAME="/\3"></A><B>/\3</B>*

\9      Like &quot;\1&quot;, but uses ninth sub-expression.	*<A NAME="/\9"></A><B>/\9</B>*
	Note: The numbering of groups is done based on which &quot;\(&quot; comes first
	in the <A HREF="#pattern">pattern</A> (going left to right), NOT based on what is matched
	first.


\&#37;(\)	A <A HREF="#pattern">pattern</A> enclosed by escaped parentheses.	*<A NAME="/\&#37;(\)"></A><B>/\&#37;(\)</B>* *<A NAME="/\&#37;("></A><B>/\&#37;(</B>* *<A NAME="E53"></A><B>E53</B>*
	Just like \(\), but without counting <A HREF="motion.html#it">it</A> <A HREF="motion.html#as">as</A> a sub-expression.  This
	allows using more groups and it's a little bit faster.
	{not in Vi}

<A HREF="change.html#x">x</A>	A single character, with no special meaning, matches itself


							*<A NAME="/\"></A><B>/\</B>* *<A NAME="/\\"></A><B>/\\</B>*
\x	A <A HREF="intro.html#backslash">backslash</A> followed by a single character, with no special meaning,
	is reserved for future expansions


<A HREF="motion.html#[]">[]</A>	(with <A HREF="options.html#'nomagic'">'nomagic'</A>: \[])		*<A NAME="/[]"></A><B>/[]</B>* *<A NAME="/\[]"></A><B>/\[]</B>* *<A NAME="/\_[]"></A><B>/\_[]</B>* *<A NAME="/collection"></A><B>/collection</B>*
\_[]
	A collection.  This is a sequence of characters enclosed in brackets.
	It matches any single character in the collection.
<B><FONT COLOR="PURPLE">	Example		matches </FONT></B>
	[xyz]		any '<A HREF="change.html#x">x</A>', '<A HREF="change.html#y">y</A>' or '<A HREF="index.html#z">z</A>'
	[a-zA-Z]$	any alphabetic character at the end of a line
	\c[a-z]$	same
	[А-яЁё]		<A HREF="russian.html#Russian">Russian</A> alphabet (with <A HREF="mbyte.html#utf-8">utf-8</A> and cp1251)


								*<A NAME="/[\n]"></A><B>/[\n]</B>*
	With &quot;\_&quot; prepended the collection also includes the end-of-line.
	The same can be done by including &quot;\n&quot; in the collection.  The
	end-of-line is also matched when the collection starts with &quot;<A HREF="motion.html#^">^</A>&quot;!  Thus
	&quot;\_[^ab]&quot; matches the end-of-line and any character but &quot;<A HREF="insert.html#a">a</A>&quot; and &quot;<A HREF="motion.html#b">b</A>&quot;.
	This makes <A HREF="motion.html#it">it</A> <A HREF="intro.html#Vi">Vi</A> compatible: Without the &quot;\_&quot; or &quot;\n&quot; the collection
	does not match an end-of-line.

								*<A NAME="E769"></A><B>E769</B>*
	When the '<A HREF="index.html#]">]</A>' is not there Vim will not give an error message but
	assume no collection is used.  Useful to search for '<A HREF="index.html#[">[</A>'.  However, you
	<A HREF="diff.html#do">do</A> get <A HREF="#E769">E769</A> for internal searching.  And be aware that in a
	`:substitute` command the whole command becomes the <A HREF="#pattern">pattern</A>.  E.g.
	&quot;:s/[/x/&quot; searches for &quot;[/x&quot; and replaces <A HREF="motion.html#it">it</A> with nothing.  It does
	not search for &quot;<A HREF="index.html#[">[</A>&quot; and replaces <A HREF="motion.html#it">it</A> with &quot;<A HREF="change.html#x">x</A>&quot;!


								*<A NAME="E944"></A><B>E944</B>* *<A NAME="E945"></A><B>E945</B>*
	If the sequence begins with &quot;<A HREF="motion.html#^">^</A>&quot;, <A HREF="motion.html#it">it</A> matches any single character NOT
	in the collection: &quot;[^xyz]&quot; matches anything but '<A HREF="change.html#x">x</A>', '<A HREF="change.html#y">y</A>' and '<A HREF="index.html#z">z</A>'.
	- If two characters in the sequence are separated by '<A HREF="motion.html#-">-</A>', this is
	  shorthand for the full <A HREF="eval.html#list">list</A> of ASCII characters between them.  E.g.,
	  &quot;[0-9]&quot; matches any decimal digit. If the starting character exceeds
	  the ending character, e.g. [c-a], <A HREF="#E944">E944</A> occurs. Non-ASCII characters
	  can be used, but the character values must not be more than 256 apart
	  in the old <A HREF="#regexp">regexp</A> engine. For example, searching by [\u3000-\u4000]
	  after setting re=1 emits a <A HREF="#E945">E945</A> error. Prepending \&#37;#=2 will fix <A HREF="motion.html#it">it</A>.
	- A character class <A HREF="eval.html#expression">expression</A> is evaluated to the set of characters
	  belonging to that character class.  The following character classes
	  are supported:
<B><FONT COLOR="PURPLE">		  Name	      Func	Contents </FONT></B>

*<A NAME="[:alnum:]"></A><B>[:alnum:]</B>*	  <A HREF="#[:alnum:]">[:alnum:]</A>   isalnum	ASCII letters and digits

*<A NAME="[:alpha:]"></A><B>[:alpha:]</B>*	  <A HREF="#[:alpha:]">[:alpha:]</A>   isalpha  	ASCII letters

*<A NAME="[:blank:]"></A><B>[:blank:]</B>*	  <A HREF="#[:blank:]">[:blank:]</A>     	space and <A HREF="intro.html#tab">tab</A>

*<A NAME="[:cntrl:]"></A><B>[:cntrl:]</B>*	  <A HREF="#[:cntrl:]">[:cntrl:]</A>   iscntrl 	ASCII <A HREF="intro.html#control">control</A> characters

*<A NAME="[:digit:]"></A><B>[:digit:]</B>*	  <A HREF="#[:digit:]">[:digit:]</A>     	decimal digits '<A HREF="motion.html#0">0</A>' to '9'

*<A NAME="[:graph:]"></A><B>[:graph:]</B>*	  <A HREF="#[:graph:]">[:graph:]</A>   isgraph	ASCII printable characters excluding
					space

*<A NAME="[:lower:]"></A><B>[:lower:]</B>*	  <A HREF="#[:lower:]">[:lower:]</A>   (1)	<A HREF="change.html#lowercase">lowercase</A> letters (all letters when
					<A HREF="options.html#'ignorecase'">'ignorecase'</A> is used)

*<A NAME="[:print:]"></A><B>[:print:]</B>*	  <A HREF="#[:print:]">[:print:]</A>   (2) 	printable characters including space

*<A NAME="[:punct:]"></A><B>[:punct:]</B>*	  <A HREF="#[:punct:]">[:punct:]</A>   ispunct	ASCII punctuation characters

*<A NAME="[:space:]"></A><B>[:space:]</B>*	  <A HREF="#[:space:]">[:space:]</A>     	<A HREF="#whitespace">whitespace</A> characters: space, <A HREF="intro.html#tab">tab</A>, CR,
					NL, vertical <A HREF="intro.html#tab">tab</A>, form feed

*<A NAME="[:upper:]"></A><B>[:upper:]</B>*	  <A HREF="#[:upper:]">[:upper:]</A>   (3)	<A HREF="change.html#uppercase">uppercase</A> letters (all letters when
					<A HREF="options.html#'ignorecase'">'ignorecase'</A> is used)

*<A NAME="[:xdigit:]"></A><B>[:xdigit:]</B>*	  <A HREF="#[:xdigit:]">[:xdigit:]</A>    	hexadecimal digits: 0-9, a-f, A-F

*<A NAME="[:return:]"></A><B>[:return:]</B>*	  <A HREF="#[:return:]">[:return:]</A>		the <A HREF="motion.html#&lt;CR&gt;">&lt;CR&gt;</A> character

*<A NAME="[:tab:]"></A><B>[:tab:]</B>*	  <A HREF="#[:tab:]">[:tab:]</A>		the <A HREF="motion.html#&lt;Tab&gt;">&lt;Tab&gt;</A> character

*<A NAME="[:escape:]"></A><B>[:escape:]</B>*	  <A HREF="#[:escape:]">[:escape:]</A>		the <A HREF="intro.html#&lt;Esc&gt;">&lt;Esc&gt;</A> character

*<A NAME="[:backspace:]"></A><B>[:backspace:]</B>*	  <A HREF="#[:backspace:]">[:backspace:]</A>		the <A HREF="motion.html#&lt;BS&gt;">&lt;BS&gt;</A> character
	  The brackets in character class expressions are additional to the
	  brackets delimiting a collection.  For example, the following is a
	  plausible <A HREF="#pattern">pattern</A> for a UNIX filename: &quot;[-./[:alnum:]_~]\+&quot; That is,
	  a <A HREF="eval.html#list">list</A> of at least one character, each of which is either '<A HREF="motion.html#-">-</A>', '<A HREF="repeat.html#.">.</A>',
	  '<A HREF="#/">/</A>', alphabetic, numeric, '<A HREF="motion.html#_">_</A>' or '<A HREF="change.html#~">~</A>'.
	  These items only work for 8-bit characters, except <A HREF="#[:lower:]">[:lower:]</A> and
	  <A HREF="#[:upper:]">[:upper:]</A> also work for <A HREF="mbyte.html#multi-byte">multi-byte</A> characters when using the new
	  <A HREF="#regexp">regexp</A> engine.  See |<A HREF="#two-engines">two-engines</A>|.  In the future these items may
	  work for <A HREF="mbyte.html#multi-byte">multi-byte</A> characters.  For now, to get all &quot;alpha&quot;
	  characters you can use: [[:lower:][:upper:]].

	  The &quot;Func&quot; column shows what library function is used.  The
	  implementation depends on the system.  Otherwise:
	  (1) Uses islower() for ASCII and Vim builtin rules for other
	  characters when built with the |<A HREF="various.html#+multi_byte">+multi_byte</A>| feature.
	  (2) Uses Vim builtin rules
	  (3) As with (1) but using isupper()

							*<A NAME="/[[="></A><B>/[[=</B>* *<A NAME="[==]"></A><B>[==]</B>*
	- An equivalence class.  This means that characters are matched that
	  have almost the same meaning, e.g., when ignoring accents.  This
	  only works for <A HREF="mbyte.html#Unicode">Unicode</A>, latin1 and latin9.  The form is:
		[=a=]

							*<A NAME="/[[."></A><B>/[[.</B>* *<A NAME="[..]"></A><B>[..]</B>*
	- A collation element.  This currently simply accepts a single
	  character in the form:
		[.a.]

							  *<A NAME="/\]"></A><B>/\]</B>*
	- To include a literal '<A HREF="index.html#]">]</A>', '<A HREF="motion.html#^">^</A>', '<A HREF="motion.html#-">-</A>' or '\' in the collection, put a
	  <A HREF="intro.html#backslash">backslash</A> before <A HREF="motion.html#it">it</A>: &quot;[xyz\]]&quot;, &quot;[\^xyz]&quot;, &quot;[xy\-z]&quot; and &quot;[xyz\\]&quot;.
	  (Note: POSIX does not support the use of a <A HREF="intro.html#backslash">backslash</A> this way).  For
	  '<A HREF="index.html#]">]</A>' you can also make <A HREF="motion.html#it">it</A> the first character (following a possible
	  &quot;^&quot;):  &quot;[]xyz]&quot; or &quot;[^]xyz]&quot; {not in Vi}.
	  For '<A HREF="motion.html#-">-</A>' you can also make <A HREF="motion.html#it">it</A> the first or last character: &quot;[-xyz]&quot;,
	  &quot;[^-xyz]&quot; or &quot;[xyz-]&quot;.  For '\' you can also let <A HREF="motion.html#it">it</A> be followed by
	  any character that's not in &quot;^]-\bdertnoUux&quot;.  &quot;[\xyz]&quot; matches '\',
	  '<A HREF="change.html#x">x</A>', '<A HREF="change.html#y">y</A>' and '<A HREF="index.html#z">z</A>'.  It's better to use &quot;\\&quot; though, future expansions
	  may use other characters after '\'.
	- Omitting the trailing ] is not considered an error. &quot;<A HREF="motion.html#[]">[]</A>&quot; works like
	  &quot;[]]&quot;, <A HREF="motion.html#it">it</A> matches the '<A HREF="index.html#]">]</A>' character.
	- The following translations are accepted when the '<A HREF="motion.html#l">l</A>' flag is not
	  included in <A HREF="options.html#'cpoptions'">'cpoptions'</A> {not in Vi}:
		\e	<A HREF="intro.html#&lt;Esc&gt;">&lt;Esc&gt;</A>
		\t	<A HREF="motion.html#&lt;Tab&gt;">&lt;Tab&gt;</A>
		\r	<A HREF="motion.html#&lt;CR&gt;">&lt;CR&gt;</A>	(NOT end-of-line!)
		\b	<A HREF="motion.html#&lt;BS&gt;">&lt;BS&gt;</A>
		\n	line break, see above |<A HREF="#/[\n]">/[\n]</A>|
		\d123	decimal number of character
		\o40	<A HREF="eval.html#octal">octal</A> number of character up to 0377
		\x20	hexadecimal number of character up to 0xff
		\u20AC	hex. number of <A HREF="mbyte.html#multibyte">multibyte</A> character up to 0xffff
		\U1234	hex. number of <A HREF="mbyte.html#multibyte">multibyte</A> character up to 0xffffffff
	  NOTE: The other <A HREF="intro.html#backslash">backslash</A> codes mentioned above <A HREF="diff.html#do">do</A> not work inside
	  <A HREF="motion.html#[]">[]</A>!
	- Matching with a collection can be slow, because each character in
	  the text has to be compared with each character in the collection.
	  Use one of the other atoms above when possible.  Example: &quot;\d&quot; is
	  much faster than &quot;[0-9]&quot; and matches the same characters.


						*<A NAME="/\&#37;[]"></A><B>/\&#37;[]</B>* *<A NAME="E69"></A><B>E69</B>* *<A NAME="E70"></A><B>E70</B>* *<A NAME="E369"></A><B>E369</B>*
\&#37;[]	A sequence of optionally matched atoms.  This always matches.
	It matches <A HREF="motion.html#as">as</A> much of the <A HREF="eval.html#list">list</A> of atoms <A HREF="motion.html#it">it</A> contains <A HREF="motion.html#as">as</A> possible.  Thus
	<A HREF="motion.html#it">it</A> stops at the first atom that doesn't match.  For example:
<B>		/r\%[ead]</B>
 	matches &quot;<A HREF="change.html#r">r</A>&quot;, &quot;re&quot;, &quot;rea&quot; or &quot;read&quot;.  The longest that matches is used.
	To match the <A HREF="intro.html#Ex">Ex</A> command &quot;function&quot;, where &quot;fu&quot; is required and
	&quot;nction&quot; is optional, this would work:
<B>		/\&lt;fu\%[nction]\&gt;</B>
 	The end-of-word atom &quot;\&gt;&quot; is used to avoid matching &quot;fu&quot; in &quot;full&quot;.
	It gets more complicated when the atoms are not ordinary characters.
	You don't often have to use <A HREF="motion.html#it">it</A>, but <A HREF="motion.html#it">it</A> is possible.  Example:
<B>		/\&lt;r\%[[eo]ad]\&gt;</B>
 	Matches the words &quot;<A HREF="change.html#r">r</A>&quot;, &quot;re&quot;, &quot;ro&quot;, &quot;rea&quot;, &quot;roa&quot;, &quot;read&quot; and &quot;road&quot;.
	There can be no \(\), \&#37;(\) or \z(\) items inside the <A HREF="motion.html#[]">[]</A> and \&#37;[] does
	not nest.
	To include a &quot;<A HREF="index.html#[">[</A>&quot; use &quot;[[]&quot; and for &quot;<A HREF="index.html#]">]</A>&quot; use []]&quot;, e.g.,:
<B>		/index\%[[[]0[]]]</B>
 	matches &quot;index&quot; &quot;index[&quot;, &quot;index[0&quot; and &quot;index[0]&quot;.
	{not available when compiled without the |<A HREF="various.html#+syntax">+syntax</A>| feature}


				*<A NAME="/\&#37;d"></A><B>/\&#37;d</B>* *<A NAME="/\&#37;x"></A><B>/\&#37;x</B>* *<A NAME="/\&#37;o"></A><B>/\&#37;o</B>* *<A NAME="/\&#37;u"></A><B>/\&#37;u</B>* *<A NAME="/\&#37;U"></A><B>/\&#37;U</B>* *<A NAME="E678"></A><B>E678</B>*

\&#37;d123	Matches the character specified with a decimal number.  Must be
	followed by a non-digit.
\&#37;o40	Matches the character specified with an <A HREF="eval.html#octal">octal</A> number up to 0377.
	Numbers below 040 must be followed by a non-octal digit or a non-digit.
\&#37;x2a	Matches the character specified with up to two hexadecimal characters.
\&#37;u20AC	Matches the character specified with up to four hexadecimal
	characters.
\&#37;U1234abcd	Matches the character specified with up to eight hexadecimal
	characters.

==============================================================================

7. Ignoring <A HREF="change.html#case">case</A> in a <A HREF="#pattern">pattern</A>					*<A NAME="/ignorecase"></A><B>/ignorecase</B>*

If the <A HREF="options.html#'ignorecase'">'ignorecase'</A> option is on, the <A HREF="change.html#case">case</A> of normal letters is ignored.
<A HREF="options.html#'smartcase'">'smartcase'</A> can be set to ignore <A HREF="change.html#case">case</A> when the <A HREF="#pattern">pattern</A> contains <A HREF="change.html#lowercase">lowercase</A>
letters only.

							*<A NAME="/\c"></A><B>/\c</B>* *<A NAME="/\C"></A><B>/\C</B>*
When &quot;\c&quot; appears anywhere in the <A HREF="#pattern">pattern</A>, the whole <A HREF="#pattern">pattern</A> is handled like
<A HREF="options.html#'ignorecase'">'ignorecase'</A> is on.  The actual value of <A HREF="options.html#'ignorecase'">'ignorecase'</A> and <A HREF="options.html#'smartcase'">'smartcase'</A> is
ignored.  &quot;\C&quot; does the opposite: Force matching <A HREF="change.html#case">case</A> for the whole <A HREF="#pattern">pattern</A>.
{only Vim supports \c and \C}
Note that <A HREF="options.html#'ignorecase'">'ignorecase'</A>, &quot;\c&quot; and &quot;\C&quot; are not used for the character classes.

Examples:
<B><FONT COLOR="PURPLE">      pattern	'ignorecase'  'smartcase'	matches </FONT></B>
	foo	  off		-		foo
	foo	  on		-		foo Foo FOO
	Foo	  on		off		foo Foo FOO
	Foo	  on		on		    Foo
	\cfoo	  -		-		foo Foo FOO
	foo\C	  -		-		foo


Technical detail:				*<A NAME="NL-used-for-Nul"></A><B>NL-used-for-Nul</B>*
<A HREF="intro.html#&lt;Nul&gt;">&lt;Nul&gt;</A> characters in the file are stored <A HREF="motion.html#as">as</A> <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A> in memory.  In the display
they are shown <A HREF="motion.html#as">as</A> &quot;^@&quot;.  The translation is done when reading and <A HREF="editing.html#writing">writing</A>
files.  To match a <A HREF="intro.html#&lt;Nul&gt;">&lt;Nul&gt;</A> with a search <A HREF="#pattern">pattern</A> you can just enter CTRL-@ or
&quot;<A HREF="visual.html#CTRL-V">CTRL-V</A> 000&quot;.  This is probably just what you expect.  Internally the
character is replaced with a <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A> in the search <A HREF="#pattern">pattern</A>.  What is unusual is
that typing <A HREF="visual.html#CTRL-V">CTRL-V</A> <A HREF="motion.html#CTRL-J">CTRL-J</A> also inserts a <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A>, thus also searches for a <A HREF="intro.html#&lt;Nul&gt;">&lt;Nul&gt;</A>
in the file.  {Vi cannot handle <A HREF="intro.html#&lt;Nul&gt;">&lt;Nul&gt;</A> characters in the file at all}


						*<A NAME="CR-used-for-NL"></A><B>CR-used-for-NL</B>*
When <A HREF="options.html#'fileformat'">'fileformat'</A> is &quot;<A HREF="os_mac.html#mac">mac</A>&quot;, <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A> characters in the file are stored <A HREF="motion.html#as">as</A> <A HREF="motion.html#&lt;CR&gt;">&lt;CR&gt;</A>
characters internally.  In the text they are shown <A HREF="motion.html#as">as</A> &quot;^J&quot;.  Otherwise this
works similar to the usage of <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A> for a <A HREF="intro.html#&lt;Nul&gt;">&lt;Nul&gt;</A>.

When working with <A HREF="eval.html#expression">expression</A> evaluation, a <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A> character in the <A HREF="#pattern">pattern</A>
matches a <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A> in the <A HREF="eval.html#string">string</A>.  The use of &quot;\n&quot; (backslash <A HREF="#n">n</A>) to match a <A HREF="motion.html#&lt;NL&gt;">&lt;NL&gt;</A>
doesn't work there, <A HREF="motion.html#it">it</A> only works to match text in the buffer.


						*<A NAME="pattern-multi-byte"></A><B>pattern-multi-byte</B>*
Patterns will also work with <A HREF="mbyte.html#multi-byte">multi-byte</A> characters, mostly <A HREF="motion.html#as">as</A> you would
expect.  But invalid bytes may cause trouble, a <A HREF="#pattern">pattern</A> with an invalid byte
will probably never match.

==============================================================================

8. Composing characters					*<A NAME="patterns-composing"></A><B>patterns-composing</B>*


							*<A NAME="/\Z"></A><B>/\Z</B>*
When &quot;\Z&quot; appears anywhere in the <A HREF="#pattern">pattern</A>, all composing characters are
ignored.  Thus only the base characters need to match, the composing
characters may be different and the number of composing characters may differ.
Only relevant when <A HREF="options.html#'encoding'">'encoding'</A> is &quot;<A HREF="mbyte.html#utf-8">utf-8</A>&quot;.
Exception: If the <A HREF="#pattern">pattern</A> starts with one or more composing characters, these
must match.

							*<A NAME="/\&#37;C"></A><B>/\&#37;C</B>*
Use &quot;\&#37;C&quot; to skip any composing characters.  For example, the <A HREF="#pattern">pattern</A> &quot;<A HREF="insert.html#a">a</A>&quot; does
not match in &quot;càt&quot; (where the a has the composing character 0x0300), but
&quot;a\&#37;C&quot; does.  Note that this does not match &quot;cát&quot; (where the á is character
0xe1, <A HREF="motion.html#it">it</A> does not have a compositing character).  It does match &quot;cat&quot; (where
the a is just an <A HREF="motion.html#a)">a)</A>.

When a composing character appears at the start of the <A HREF="#pattern">pattern</A> of after an
item that doesn't include the composing character, a match is found at any
character that includes this composing character.

When using a dot and a composing character, this works the same <A HREF="motion.html#as">as</A> the
composing character by itself, except that <A HREF="motion.html#it">it</A> doesn't matter what comes before
this.

The order of composing characters does not matter.  Also, the text may have
more composing characters than the <A HREF="#pattern">pattern</A>, <A HREF="motion.html#it">it</A> still matches.  But all
composing characters in the <A HREF="#pattern">pattern</A> must be found in the text.

Suppose <A HREF="motion.html#B">B</A> is a base character and <A HREF="change.html#x">x</A> and <A HREF="change.html#y">y</A> are composing characters:
<B><FONT COLOR="PURPLE">	pattern		text		match </FONT></B>
	Bxy		Bxy		yes (perfect match)
	Bxy		Byx		yes (order ignored)
	Bxy		By		no (x missing)
	Bxy		Bx		no (y missing)
	Bx		Bx		yes (perfect match)
	Bx		By		no (x missing)
	Bx		Bxy		yes (extra <A HREF="change.html#y">y</A> ignored)
	Bx		Byx		yes (extra <A HREF="change.html#y">y</A> ignored)

==============================================================================

9. Compare with <A HREF="if_perl.html#Perl">Perl</A> patterns				*<A NAME="perl-patterns"></A><B>perl-patterns</B>*

Vim's regexes are most similar to Perl's, in terms of what you can <A HREF="diff.html#do">do</A>.  The
difference between them is mostly just <A HREF="intro.html#notation">notation</A>;  here's a summary of where
they differ:

<B><FONT COLOR="PURPLE">Capability			in Vimspeak	in Perlspeak </FONT></B>
force <A HREF="change.html#case">case</A> insensitivity	\c		(?i)
force <A HREF="change.html#case">case</A> sensitivity		\C		(?-i)
backref-less grouping		\&#37;(atom\)	(?:atom)
conservative quantifiers	\{-n,m}		*?, +?, ??, <A HREF="intro.html#{}">{}</A>?
0-width match			atom\@=		(?=atom)
0-width non-match		atom\@!		(?!atom)
0-width preceding match		atom\@&lt;=	(?&lt;=atom)
0-width preceding non-match	atom\@&lt;!	(?&lt;!atom)
match without retry		atom\@&gt;		(?&gt;atom)

Vim and <A HREF="if_perl.html#Perl">Perl</A> handle newline characters inside a <A HREF="eval.html#string">string</A> a bit differently:

In <A HREF="if_perl.html#Perl">Perl</A>, ^ and $ only match at the very beginning and end of the text,
by default, but you can set the '<A HREF="motion.html#m">m</A>' flag, which lets them match at
embedded newlines <A HREF="motion.html#as">as</A> well.  You can also set the '<A HREF="change.html#s">s</A>' flag, which causes
a . to match newlines <A HREF="motion.html#as">as</A> well.  (Both these flags can be changed inside
a <A HREF="#pattern">pattern</A> using the same <A HREF="syntax.html#syntax">syntax</A> used for the <A HREF="insert.html#i">i</A> flag above, BTW.)

On the other hand, Vim's ^ and $ always match at embedded newlines, and
you get two separate atoms, \&#37;^ and \&#37;$, which only match at the very
start and end of the text, respectively.  Vim solves the second problem
by giving you the \_ &quot;modifier&quot;:  put <A HREF="motion.html#it">it</A> in front of a . or a character
class, and they will match newlines <A HREF="motion.html#as">as</A> well.

Finally, these constructs are unique to <A HREF="if_perl.html#Perl">Perl</A>:
- execution of arbitrary code in the regex:  (?{perl code})
- conditional expressions:  (?(condition)true-expr|false-expr)

...and these are unique to Vim:
- <A HREF="change.html#changing">changing</A> the magic-ness of a <A HREF="#pattern">pattern</A>:  \v \V \m \M
   (very useful for avoiding backslashitis)
- sequence of optionally matching atoms:  \&#37;[atoms]
- \&amp; (which is to \| what &quot;and&quot; is to &quot;or&quot;;  <A HREF="motion.html#it">it</A> forces several branches
   to match at one spot)
- matching lines/columns by number:  \&#37;5l \&#37;5c \&#37;5v
- setting the start and end of the match:  \zs \ze

==============================================================================

10. Highlighting matches				*<A NAME="match-highlight"></A><B>match-highlight</B>*


							*<A NAME=":mat"></A><B>:mat</B>* *<A NAME=":match"></A><B>:match</B>*
:mat[ch] {group} /{pattern}/
		Define a <A HREF="#pattern">pattern</A> to highlight in the current <A HREF="windows.html#window">window</A>.  It will
		be highlighted with {group}.  Example:
<B>			:highlight MyGroup ctermbg=green guibg=green</B>
<B>			:match MyGroup /TODO/</B>
 		Instead of <A HREF="version7.html#//">//</A> any character can be used to <A HREF="motion.html#mark">mark</A> the start and
		end of the {pattern}.  Watch out for using special characters,
		such <A HREF="motion.html#as">as</A> &#39;&#34;'' and '&#124;'.

		{group} must exist at the moment this command is executed.

		The {group} highlighting still applies when a character is
		to be highlighted for <A HREF="options.html#'hlsearch'">'hlsearch'</A>, <A HREF="motion.html#as">as</A> the highlighting for
		matches is given higher priority than that of <A HREF="options.html#'hlsearch'">'hlsearch'</A>.
		<A HREF="autocmd.html#Syntax">Syntax</A> highlighting (see <A HREF="options.html#'syntax'">'syntax'</A>) is also overruled by
		matches.

		Note that highlighting the last used search <A HREF="#pattern">pattern</A> with
		<A HREF="options.html#'hlsearch'">'hlsearch'</A> is used in all <A HREF="windows.html#windows">windows</A>, while the <A HREF="#pattern">pattern</A> defined
		with &quot;<A HREF="#:match">:match</A>&quot; only exists in the current <A HREF="windows.html#window">window</A>.  It is kept
		when switching to another buffer.

		<A HREF="options.html#'ignorecase'">'ignorecase'</A> does not apply, use |<A HREF="#/\c">/\c</A>| in the <A HREF="#pattern">pattern</A> to
		ignore <A HREF="change.html#case">case</A>.  Otherwise <A HREF="change.html#case">case</A> is not ignored.

		<A HREF="options.html#'redrawtime'">'redrawtime'</A> defines the maximum time searched for <A HREF="#pattern">pattern</A>
		matches.

		When matching end-of-line and Vim redraws only part of the
		display you may get unexpected results.  That is because Vim
		looks for a match in the line where redrawing starts.

		Also see |<A HREF="eval.html#matcharg()">matcharg()</A>| and |<A HREF="eval.html#getmatches()">getmatches()</A>|. The former returns
		the highlight group and <A HREF="#pattern">pattern</A> of a previous |<A HREF="#:match">:match</A>|
		command.  The latter returns a <A HREF="eval.html#list">list</A> with highlight groups and
		patterns defined by both |<A HREF="eval.html#matchadd()">matchadd()</A>| and |<A HREF="#:match">:match</A>|.

		Highlighting matches using |<A HREF="#:match">:match</A>| are limited to three
		matches (aside from |<A HREF="#:match">:match</A>|, |<A HREF="#:2match">:2match</A>| and |<A HREF="#:3match">:3match</A>| are
		available). |<A HREF="eval.html#matchadd()">matchadd()</A>| does not have this limitation and in
		addition makes <A HREF="motion.html#it">it</A> possible to prioritize matches.

		Another example, which highlights all characters in virtual
		column 72 and more:
<B>			:highlight rightMargin term=bold ctermfg=blue guifg=blue</B>
<B>			:match rightMargin /.\%&gt;72v/</B>
 		To highlight all character that are in virtual column 7:
<B>			:highlight col8 ctermbg=grey guibg=grey</B>
<B>			:match col8 /\%&lt;8v.\%&gt;7v/</B>
 		Note the use of two items to also match a character that
		occupies more than one virtual column, such <A HREF="motion.html#as">as</A> a TAB.

:mat[ch]
:mat[ch] none
		Clear a previously defined match <A HREF="#pattern">pattern</A>.



:2mat[ch] {group} /{pattern}/					*<A NAME=":2match"></A><B>:2match</B>*
:2mat[ch]
:2mat[ch] none

:3mat[ch] {group} /{pattern}/					*<A NAME=":3match"></A><B>:3match</B>*
:3mat[ch]
:3mat[ch] none
		Just like |<A HREF="#:match">:match</A>| above, but set a separate match.  Thus
		there can be three matches active at the same time.  The match
		with the lowest number has priority if several match at the
		same position.
		The &quot;<A HREF="#:3match">:3match</A>&quot; command is used by the |<A HREF="pi_paren.html#matchparen">matchparen</A>| <A HREF="usr_05.html#plugin">plugin</A>.  You
		are suggested to use &quot;<A HREF="#:match">:match</A>&quot; for manual matching and
		&quot;<A HREF="#:2match">:2match</A>&quot; for another <A HREF="usr_05.html#plugin">plugin</A>.


<A HREF="#top">top</A> - <A HREF="index.html">main help file</A>
</PRE>
</BODY>


</HTML>