@@ -357,7 +357,7 @@ public RegexBuilder nonDigit(final RegexQuantifier quantifier) {
357
357
}
358
358
359
359
/**
360
- * Add an element to match any letter in the Roman alphabet (a-z, A-Z)
360
+ * Add an element to match any Unicode letter
361
361
*
362
362
* @return The current {@link RegexBuilder} object, for method chaining
363
363
*/
@@ -366,19 +366,19 @@ public RegexBuilder letter() {
366
366
}
367
367
368
368
/**
369
- * Add an element to match any letter in the Roman alphabet (a-z, A-Z)
369
+ * Add an element to match any Unicode letter
370
370
*
371
371
* @param quantifier Quantifier to apply to this element
372
372
* @return The current {@link RegexBuilder} object, for method chaining
373
373
*/
374
374
public RegexBuilder letter (final RegexQuantifier quantifier ) {
375
- stringBuilder .append ("[a-zA-Z] " );
375
+ stringBuilder .append ("\\ p{L} " );
376
376
addQuantifier (quantifier );
377
377
return this ;
378
378
}
379
379
380
380
/**
381
- * Add an element to match any character that is not a letter in the Roman alphabet (a-z, A-Z)
381
+ * Add an element to match any character that is not a Unicode letter
382
382
*
383
383
* @return The current {@link RegexBuilder} object, for method chaining
384
384
*/
@@ -387,19 +387,19 @@ public RegexBuilder nonLetter() {
387
387
}
388
388
389
389
/**
390
- * Add an element to match any character that is not a letter in the Roman alphabet (a-z, A-Z)
390
+ * Add an element to match any character that is not a Unicode letter
391
391
*
392
392
* @param quantifier Quantifier to apply to this element
393
393
* @return The current {@link RegexBuilder} object, for method chaining
394
394
*/
395
395
public RegexBuilder nonLetter (final RegexQuantifier quantifier ) {
396
- stringBuilder .append ("[^a-zA-Z] " );
396
+ stringBuilder .append ("\\ P{L} " );
397
397
addQuantifier (quantifier );
398
398
return this ;
399
399
}
400
400
401
401
/**
402
- * Add an element to match any upper-case letter in the Roman alphabet (A-Z).
402
+ * Add an element to match any upper-case Unicode letter
403
403
*
404
404
* @return The current {@link RegexBuilder} object, for method chaining
405
405
*/
@@ -408,19 +408,19 @@ public RegexBuilder uppercaseLetter() {
408
408
}
409
409
410
410
/**
411
- * Add an element to match any upper-case letter in the Roman alphabet (A-Z).
411
+ * Add an element to match any upper-case Unicode letter
412
412
*
413
413
* @param quantifier Quantifier to apply to this element
414
414
* @return The current {@link RegexBuilder} object, for method chaining
415
415
*/
416
416
public RegexBuilder uppercaseLetter (final RegexQuantifier quantifier ) {
417
- stringBuilder .append ("[A-Z] " );
417
+ stringBuilder .append ("\\ p{Lu} " );
418
418
addQuantifier (quantifier );
419
419
return this ;
420
420
}
421
421
422
422
/**
423
- * Add an element to match any lowercase letter in the Roman alphabet (a-z)
423
+ * Add an element to match any lowercase Unicode letter
424
424
*
425
425
* @return The current {@link RegexBuilder} object, for method chaining
426
426
*/
@@ -429,19 +429,19 @@ public RegexBuilder lowercaseLetter() {
429
429
}
430
430
431
431
/**
432
- * Add an element to match any lowercase letter in the Roman alphabet (a-z)
432
+ * Add an element to match any lowercase Unicode letter
433
433
*
434
434
* @param quantifier Quantifier to apply to this element
435
435
* @return The current {@link RegexBuilder} object, for method chaining
436
436
*/
437
437
public RegexBuilder lowercaseLetter (final RegexQuantifier quantifier ) {
438
- stringBuilder .append ("[a-z] " );
438
+ stringBuilder .append ("\\ p{Ll} " );
439
439
addQuantifier (quantifier );
440
440
return this ;
441
441
}
442
442
443
443
/**
444
- * Add an element to match any letter in the Roman alphabet or decimal digit (a-z, A-Z, 0-9)
444
+ * Add an element to match any Unicode letter or decimal digit
445
445
*
446
446
* @return The current {@link RegexBuilder} object, for method chaining
447
447
*/
@@ -450,19 +450,19 @@ public RegexBuilder letterOrDigit() {
450
450
}
451
451
452
452
/**
453
- * Add an element to match any letter in the Roman alphabet or decimal digit (a-z, A-Z, 0-9)
453
+ * Add an element to match any Unicode letter or decimal digit
454
454
*
455
455
* @param quantifier Quantifier to apply to this element
456
456
* @return The current {@link RegexBuilder} object, for method chaining
457
457
*/
458
458
public RegexBuilder letterOrDigit (final RegexQuantifier quantifier ) {
459
- stringBuilder .append ("[a-zA-Z0 -9]" );
459
+ stringBuilder .append ("[\\ p{L}0 -9]" );
460
460
addQuantifier (quantifier );
461
461
return this ;
462
462
}
463
463
464
464
/**
465
- * Add an element to match any character that is not letter in the Roman alphabet or a decimal digit (a-z, A-Z, 0-9)
465
+ * Add an element to match any character that is not a Unicode letter or a decimal digit
466
466
*
467
467
* @return The current {@link RegexBuilder} object, for method chaining
468
468
*/
@@ -471,13 +471,13 @@ public RegexBuilder nonLetterOrDigit() {
471
471
}
472
472
473
473
/**
474
- * Add an element to match any character that is not letter in the Roman alphabet or a decimal digit (a-z, A-Z, 0-9)
474
+ * Add an element to match any character that is not a Unicode letter or a decimal digit
475
475
*
476
476
* @param quantifier Quantifier to apply to this element
477
477
* @return The current {@link RegexBuilder} object, for method chaining
478
478
*/
479
479
public RegexBuilder nonLetterOrDigit (final RegexQuantifier quantifier ) {
480
- stringBuilder .append ("[^a-zA-Z0 -9]" );
480
+ stringBuilder .append ("[^\\ p{L}0 -9]" );
481
481
addQuantifier (quantifier );
482
482
return this ;
483
483
}
@@ -567,7 +567,7 @@ public RegexBuilder nonHexDigit(final RegexQuantifier quantifier) {
567
567
}
568
568
569
569
/**
570
- * Add an element to match any Roman alphabet letter, decimal digit, or underscore (a-z, A-Z, 0-9, _)
570
+ * Add an element to match any Unicode letter, decimal digit, or underscore
571
571
*
572
572
* @return The current {@link RegexBuilder} object, for method chaining
573
573
*/
@@ -576,20 +576,19 @@ public RegexBuilder wordCharacter() {
576
576
}
577
577
578
578
/**
579
- * Add an element to match any Roman alphabet letter, decimal digit, or underscore (a-z, A-Z, 0-9, _)
579
+ * Add an element to match any Unicode letter, decimal digit, or underscore
580
580
*
581
581
* @param quantifier Quantifier to apply to this element
582
582
* @return The current {@link RegexBuilder} object, for method chaining
583
583
*/
584
584
public RegexBuilder wordCharacter (final RegexQuantifier quantifier ) {
585
- stringBuilder .append ("\\ w " );
585
+ stringBuilder .append ("[ \\ p{L}0-9_] " );
586
586
addQuantifier (quantifier );
587
587
return this ;
588
588
}
589
589
590
590
/**
591
- * Add an element to match any character that is not a Roman alphabet letter, decimal digit, or underscore
592
- * (a-z, A-Z, 0-9, _)
591
+ * Add an element to match any character that is not a Unicode letter, decimal digit, or underscore
593
592
*
594
593
* @return The current {@link RegexBuilder} object, for method chaining
595
594
*/
@@ -598,14 +597,13 @@ public RegexBuilder nonWordCharacter() {
598
597
}
599
598
600
599
/**
601
- * Add an element to match any character that is not a Roman alphabet letter, decimal digit, or underscore
602
- * (a-z, A-Z, 0-9, _)
600
+ * Add an element to match any character that is not a Unicode letter, decimal digit, or underscore
603
601
*
604
602
* @param quantifier Quantifier to apply to this element
605
603
* @return The current {@link RegexBuilder} object, for method chaining
606
604
*/
607
605
public RegexBuilder nonWordCharacter (final RegexQuantifier quantifier ) {
608
- stringBuilder .append ("\\ W " );
606
+ stringBuilder .append ("[^ \\ p{L}0-9_] " );
609
607
addQuantifier (quantifier );
610
608
return this ;
611
609
}
0 commit comments