14. Mining text to find meaningful data Flashcards
What function returns data on the length of a string?
char_length() with
What does the function char_length() return
The number of characters in a string including spaces
If I want to identify a substring what function could I use?
position(**substring ** in string)
SQL
What function can remove the beginning and ending of a string?
trim(characters from string)
SQL
If I wanted to remove the letter s from string. What fucntion would I use and how would I set it up?
trim( āsā from string)
If I only want to remove the first letter only what parameter do I use?
trim()
leading
If I want to remove only the last letter in a string what agrument would I use?
trim()
trailing
What are Regular expressions?
they are a type of notational language that describes text patterns
what is a type of notational language that describes test patterns
regular espressions
Expression: .
a dot is a wildcard that finds any character except a newline.
Expression [FGz]
any character in square brackets []
Expression: [a-z]
a range of characters. Here lowercase a to z
Expression: [^a-z]
Regular expressions
the caret negates the match. Here not losercase a-z
RE: \w
any word character or underscore. Same as [A-Za-z0-9]
RE: \d
any digit
RE: \s
a space
RE: \t
tab character
RE: \n
new line character
RE: \r
Carriage return Character
RE: ^
match at the start of the string
RE: $
Match at the end of the string
RE: ?
get the preceding match zero or one time
RE: *
get the preceding match zero or more times
RE: +
get the preceeding match one or more times
RE: {m}
get the preceding match exactly m times
RE: {m,n}
get the preceding match between m and n times
RE: a | b
The piple denotes alteration . Find either a or b
RE: ()
Create and report a capture group or set precendence
RE (?: )
Negate the reporting of a capture group