Skip to content

Commit

Permalink
Changed newline to support all platforms with \R
Browse files Browse the repository at this point in the history
Get RegEx highlight with @language("RegExp") when using regexText.
  • Loading branch information
Cyberavater committed Feb 22, 2024
1 parent 8d6ff76 commit b102077
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/RegexBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RegexBuilder internal constructor() {
* @param quantifier Quantifier to apply to the whole string
* @return The current [RegexBuilder] object, for method chaining
*/
fun regexText(text: String, quantifier: RegexQuantifier? = null): RegexBuilder =
fun regexText(@Language("RegExp") text: String, quantifier: RegexQuantifier? = null): RegexBuilder =
if (quantifier == null) {
addPart(text)
} else {
Expand Down Expand Up @@ -123,7 +123,7 @@ class RegexBuilder internal constructor() {
* @return The current [RegexBuilder] object, for method chaining
*/
fun lineFeed(quantifier: RegexQuantifier? = null) =
addPart("\\n", quantifier)
addPart("""\R""", quantifier)

/**
* Add an element to match a single carriage return character.
Expand Down

0 comments on commit b102077

Please sign in to comment.