PHP 8.2.31
Preview: cdesc-StringScanner.yaml Size: 7.41 KB
/proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/StringScanner/cdesc-StringScanner.yaml

--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: must_C_version
- !ruby/object:RI::MethodSummary 
  name: new
comment: 
- !ruby/struct:SM::Flow::P 
  body: "StringScanner provides for lexical scanning operations on a String. Here is an example of its usage:"
- !ruby/struct:SM::Flow::VERB 
  body: "  s = StringScanner.new('This is an example string')\n  s.eos?               # -> false\n\n  p s.scan(/\\w+/)      # -> "This"\n  p s.scan(/\\w+/)      # -> nil\n  p s.scan(/\\s+/)      # -> " "\n  p s.scan(/\\s+/)      # -> nil\n  p s.scan(/\\w+/)      # -> "is"\n  s.eos?               # -> false\n\n  p s.scan(/\\s+/)      # -> " "\n  p s.scan(/\\w+/)      # -> "an"\n  p s.scan(/\\s+/)      # -> " "\n  p s.scan(/\\w+/)      # -> "example"\n  p s.scan(/\\s+/)      # -> " "\n  p s.scan(/\\w+/)      # -> "string"\n  s.eos?               # -> true\n\n  p s.scan(/\\s+/)      # -> nil\n  p s.scan(/\\w+/)      # -> nil\n"
- !ruby/struct:SM::Flow::P 
  body: Scanning a string means remembering the position of a <em>scan pointer</em>, which is just an index. The point of scanning is to move forward a bit at a time, so matches are sought after the scan pointer; usually immediately after it.
- !ruby/struct:SM::Flow::P 
  body: "Given the string &quot;test string&quot;, here are the pertinent scan pointer positions:"
- !ruby/struct:SM::Flow::VERB 
  body: "    t e s t   s t r i n g\n  0 1 2 ...             1\n                        0\n"
- !ruby/struct:SM::Flow::P 
  body: "When you #scan for a pattern (a regular expression), the match must occur at the character after the scan pointer. If you use #scan_until, then the match can occur anywhere after the scan pointer. In both cases, the scan pointer moves <em>just beyond</em> the last character of the match, ready to scan again from the next character onwards. This is demonstrated by the example above."
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Method Categories
- !ruby/struct:SM::Flow::P 
  body: There are other methods besides the plain scanners. You can look ahead in the string without actually scanning. You can access the most recent match. You can modify the string being scanned, reset or terminate the scanner, find out or change the position of the scan pointer, skip ahead, and so on.
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Advancing the Scan Pointer
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#getch"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#get_byte"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#scan"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#scan_until"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#skip"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#skip_until"
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Looking Ahead
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#check"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#check_until"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#exist?"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#match?"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#peek"
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Finding Where we Are
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#beginning_of_line? (#bol?)"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#eos?"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#rest?"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#rest_size"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#pos"
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Setting Where we Are
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#reset"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#terminate"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#pos="
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Match Data
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#matched"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#matched?"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#matched_size"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "[]"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#pre_match"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#post_match"
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 3
  text: Miscellaneous
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "&lt;&lt;"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#concat"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#string"
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#string="
  - !ruby/struct:SM::Flow::LI 
    label: "-"
    body: "#unscan"
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: There are aliases to several of the methods.
constants: []

full_name: StringScanner
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: "<<"
- !ruby/object:RI::MethodSummary 
  name: "[]"
- !ruby/object:RI::MethodSummary 
  name: beginning_of_line?
- !ruby/object:RI::MethodSummary 
  name: check
- !ruby/object:RI::MethodSummary 
  name: check_until
- !ruby/object:RI::MethodSummary 
  name: clear
- !ruby/object:RI::MethodSummary 
  name: concat
- !ruby/object:RI::MethodSummary 
  name: empty?
- !ruby/object:RI::MethodSummary 
  name: eos?
- !ruby/object:RI::MethodSummary 
  name: exist?
- !ruby/object:RI::MethodSummary 
  name: get_byte
- !ruby/object:RI::MethodSummary 
  name: getbyte
- !ruby/object:RI::MethodSummary 
  name: getch
- !ruby/object:RI::MethodSummary 
  name: initialize_copy
- !ruby/object:RI::MethodSummary 
  name: inspect
- !ruby/object:RI::MethodSummary 
  name: match?
- !ruby/object:RI::MethodSummary 
  name: matched
- !ruby/object:RI::MethodSummary 
  name: matched?
- !ruby/object:RI::MethodSummary 
  name: matched_size
- !ruby/object:RI::MethodSummary 
  name: matchedsize
- !ruby/object:RI::MethodSummary 
  name: peek
- !ruby/object:RI::MethodSummary 
  name: peep
- !ruby/object:RI::MethodSummary 
  name: pointer
- !ruby/object:RI::MethodSummary 
  name: pointer=
- !ruby/object:RI::MethodSummary 
  name: pos
- !ruby/object:RI::MethodSummary 
  name: pos=
- !ruby/object:RI::MethodSummary 
  name: post_match
- !ruby/object:RI::MethodSummary 
  name: pre_match
- !ruby/object:RI::MethodSummary 
  name: reset
- !ruby/object:RI::MethodSummary 
  name: rest
- !ruby/object:RI::MethodSummary 
  name: rest?
- !ruby/object:RI::MethodSummary 
  name: rest_size
- !ruby/object:RI::MethodSummary 
  name: restsize
- !ruby/object:RI::MethodSummary 
  name: scan
- !ruby/object:RI::MethodSummary 
  name: scan_full
- !ruby/object:RI::MethodSummary 
  name: scan_until
- !ruby/object:RI::MethodSummary 
  name: search_full
- !ruby/object:RI::MethodSummary 
  name: skip
- !ruby/object:RI::MethodSummary 
  name: skip_until
- !ruby/object:RI::MethodSummary 
  name: string
- !ruby/object:RI::MethodSummary 
  name: string=
- !ruby/object:RI::MethodSummary 
  name: terminate
- !ruby/object:RI::MethodSummary 
  name: unscan
name: StringScanner
superclass: Object

Directory Contents

Dirs: 1 × Files: 46

Name Size Perms Modified Actions
Error DIR
- drwxr-xr-x 2024-03-03 22:50:13
Edit Download
598 B lrw-r--r-- 2023-07-26 13:47:15
Edit Download
820 B lrw-r--r-- 2023-07-26 13:47:15
Edit Download
587 B lrw-r--r-- 2023-07-26 13:47:15
Edit Download
7.41 KB lrw-r--r-- 2023-07-26 13:47:15
Edit Download
803 B lrw-r--r-- 2023-07-26 13:47:15
Edit Download
741 B lrw-r--r-- 2023-07-26 13:47:15
Edit Download
284 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
604 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
276 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
495 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
663 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
286 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
705 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
690 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
276 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
909 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
580 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
495 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
408 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
302 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
578 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
307 B lrw-r--r-- 2023-07-26 13:47:15
Edit Download
371 B lrw-r--r-- 2023-07-26 13:47:15
Edit Download
496 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
274 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
413 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
775 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
405 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
767 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
598 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
595 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
265 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
472 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
364 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
323 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
275 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
729 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
617 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
718 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
571 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
798 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
906 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
321 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
243 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
306 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download
649 B lrw-r--r-- 2023-07-26 13:47:16
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).