Sign up or Sign in | Share
 
ClearMyBench
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Ruby basics (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Ruby basics
#4613
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
A regular expression is a special sequence of characters that helps us match or find other strings or sets of strings, using a specialized syntax held in a pattern.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4614
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
A regular expression literal is a pattern between slashes or between arbitrary delimiters followed by %r.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4615
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Regular-expression modifiers

Regular expression literals may include an optional modifier to control various aspects of matching.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4616
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Like string literals delimited with %Q, Ruby allows us to begin our regular expressions with %r followed by a delimiter of our choice.

This is useful when the pattern we are describing contains a lot of forward slash characters that we don't want to escape
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4617
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Regular-expression patterns

Except for control characters, (+ ? . * ^ $ ( ) [ ] { } | \), all characters match themselves.egular-expression patterns

Except for control characters, (+ ? . * ^ $ ( ) [ ] { } | \), all characters match themselves.

We can also escape a control character by preceding it with a backslash.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4618
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Some of the most important String methods that use regular expressions are sub and gsub , and their in-place variants sub! and gsub!.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
logo footer   Copyright 2009 - 2013 HotRecruiter.Com - All Rights Reserved