slide1
Download
Skip this Video
Download Presentation
C++

Loading in 2 Seconds...

play fullscreen
1 / 10

C++ - PowerPoint PPT Presentation


  • 157 Views
  • Uploaded on

C++. Strings, Regular Expressions, and I/O Streaming

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' C++' - jacie


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1
C++
  • Strings, Regular Expressions, and I/O Streaming
    • Strings are objects of one of the string classes - string, wstring, u16string or u32string. These classes behave as though they are one of the fundamental data types and offers an extremely rich set of functions making data manipulation very straight-forward. All of the types and functions for strings are contained in the <string> header file.
    • Regular Expressions is fundamentally pattern matching within strings. It is the use of wildcards and patterns to find or replace string segments. Regular expressions, then, can be used to:
      • Match some input with the expression
      • Search some input for the expression
      • Use some defined token in an expression (e.g. ‘*’)
      • Modify some input based upon the expression.
slide2
C++
    • I/O Streaming

All software has some sort of I/O. C++ defines a library known as the I/O Stream Library which operates various aspects of I/O. It, like C, represents I/O as streams of data rather than some physical representation.

  • Strings
    • String types, in order to be used, must be included in source code with #include <string> : string s1 (“some string”)
    • Includes wide character strings for internationalization.
    • Typical functions consist of: assign(), length(), replace(), compare(), clear(), and erase().
slide3
C++
  • Substrings and Concatenation
    • Substr() function
    • ‘+’ used for concatenation
  • Numeric Conversions
    • stoi
    • stol, stoll, stoul, and stoull
    • stof
    • stold
    • to_string and to_wstring
slide4
C++
  • Regular Expressions
    • Regex Match and Search Interface
      • #include <regex>
      • Similar to declaring a string: regex r1(“<pattern>”)
      • Grammar based upon the ECMAScript grammar.
slide5
C++

Pattern Matching

slide7
C++

Assertions and Alternatives

slide10
C++
  • Regex Operations
    • Signature Operations
      • regex_match( … )
      • regex_search( … )
      • regex_replace( … )
ad