class StringScanner extends AnyRef
A string scanner, modeled after the ruby StringScanner class.
- Alphabetic
- By Inheritance
- StringScanner
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new StringScanner(_source: String)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
append(str: String): Unit
Appends the given string to the current source.
Appends the given string to the current source. It does not affect the pointer.
-
def
apply(i: Int): Option[String]
Returns the i-th captured group of the last match if any.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bol(): Boolean
Indicates whether the current pointer is at the beginning of a line.
-
def
check(re: Regex): Option[String]
Returns the same result as
scanwould return without advancing the pointer.Returns the same result as
scanwould return without advancing the pointer. ThelastMatchedhowever is updated. -
def
checkUntil(re: Regex): Option[String]
Returns the same result as
scanUntilwould return without advancing the pointer.Returns the same result as
scanUntilwould return without advancing the pointer. ThelastMatchedhowever is updated. -
def
checkUntilExclusive(re: Regex): String
Returns the same result as
scanUntilExclusivewould return without advancing the pointer.Returns the same result as
scanUntilExclusivewould return without advancing the pointer. ThelastMatchedhowever is updated. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
eos(): Boolean
Indicates whether the current pointer is at the end of the source string.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(): Option[Char]
Returns the next character, or
Noneif EOS was reached. -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lastMatched: Option[Match]
Returns the last matched string if any, or
Noneotherwise. -
def
matches(re: Regex): Boolean
Checks that the string amtches the regular expression at the current pointer.
Checks that the string amtches the regular expression at the current pointer. Neither the
lastMatchednor thepointerare updated. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
peek(length: Int): String
Extracts the string starting at the current pointer of the given length.
Extracts the string starting at the current pointer of the given length. If fewer characters are left in the string, then the maximum possible number of characters is returned.
-
def
pointer: Int
Returns the current pointer in the scanner.
-
def
pointer_=(pos: Int): Unit
Sets the current pointer at the given position.
Sets the current pointer at the given position. Reset the
lastMatcheddata. -
def
reset(): Unit
Reset the pointer (at position 0) and clears the last match.
-
def
rest(): String
Returns the (possibly empty) rest string starting at the current pointer.
-
def
scan(re: Regex): Option[String]
Tries to match the given regular expression and returns the matched result, advancing the _pointer by the size of the matching substring.
Tries to match the given regular expression and returns the matched result, advancing the _pointer by the size of the matching substring. If it did not match, the pointer is left unchanged, and
Noneis returned. -
def
scanUntil(re: Regex): Option[String]
Scans the string until the pattern is matched and consumed.
Scans the string until the pattern is matched and consumed. Returns the substring up to and including the end of the match, advancing the pointer by the size of the matching substring. If it did not match, the pointer is left unchanged, and
Noneis returned. -
def
scanUntilExclusive(re: Regex): String
Scans the string until the pattern is matched but not consumed.
Scans the string until the pattern is matched but not consumed. Returns the substring up to and excluding the start of the match, advancing the pointer by the size of the matching substring. If it did not match, the pointer is left unchanged, and
Noneis returned. -
def
skip(re: Regex): Int
Tries to skip the given regular expression starting at the current _pointer.
Tries to skip the given regular expression starting at the current _pointer. Advances the pointer by the size of the matching string, and returns this size. If it did not match,
0is returned and the pointer is not advanced. -
def
skipUntil(re: Regex): Int
Advances the pointer until pattern is matched and consumed.
Advances the pointer until pattern is matched and consumed. Returns the size of consumed string.
-
def
skipUntilExclusive(re: Regex): Int
Advances the pointer until pattern is matched but not consumed.
Advances the pointer until pattern is matched but not consumed. Returns the size of consumed string.
-
def
source: String
Returns the string being scanned
-
def
source_=(str: String): Unit
Sets the string to scan and reset this scanner.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
terminate(): Unit
Set the pointer at the end of the input and clears the last match.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Gnieh Tekstlib
Gnieh Tekstlib is a library grouping standard classes and packages allowing people to work with texts and documents.
Package Structure
gnieh.diffdiff manipulation,gnieh.hyphenhyphenation for text in any language,gnieh.stringstrings manipulation for text processing,gnieh.mustachelightweight mustache template engine,gnieh.pppretty printing related classes,gnieh.regexregular expressions manipulation.