The document discusses regular expressions (regex), including what they are, common operations used in regex like concatenation and Kleene closure, how to convert regular expressions to nondeterministic finite automata (NFA), the differences between deterministic and nondeterministic finite automata, and some examples of using regex in programming and tools.
n this presentation, Manoj K. has talked about “Regular Expression”. Here he has explained how Regular Expressions are used. He has covered all of the codes and what they are used for. The goal is to teach you how to use regular expressions once and for all.
----------------------------------------------------------
Get Socialistic
Our website: http://valuebound.com/
LinkedIn: http://bit.ly/2eKgdux
Facebook: https://www.facebook.com/valuebound/
Twitter: https://twitter.com/valuebound
n this presentation, Manoj K. has talked about “Regular Expression”. Here he has explained how Regular Expressions are used. He has covered all of the codes and what they are used for. The goal is to teach you how to use regular expressions once and for all.
----------------------------------------------------------
Get Socialistic
Our website: http://valuebound.com/
LinkedIn: http://bit.ly/2eKgdux
Facebook: https://www.facebook.com/valuebound/
Twitter: https://twitter.com/valuebound
^Regular Expressions is one of those tools that every developer should have in their toolbox. You can do your job without regular expressions, but knowing when and how to use them will make you a much more efficient and marketable developer. You'll learn how regular expressions can be used for validating user input, parsing text, and refactoring code. We'll also cover various tools that can be used to help you write and share expressions.$
Oracle database supports perl- and POSIX-compatible regular expressions with five elegant and powerful functions: REGEXP_REPLACE, REGEXP_SUBSTR, REGEXP_INSTR, REGEXP_LIKE, and REGEXP_COUNT.
This session will demonstrate their nuances and how to use them effectively for data cleansing, manipulation and selection, for validating things such as Social Security Numbers, credit cards, IP addresses, phone numbers, DNAs, XMLs, for extracting things such as email-ids, hostnames from URLs and strings, and for transposing delimited columns to rows. There will be a demo of a few tricky examples taken from forums.oracle.com and asktom.oracle.com.
The session will end with fuzzy matching and optimization techniques, and things to watch out for.
http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_regexp.htm
^Regular Expressions is one of those tools that every developer should have in their toolbox. You can do your job without regular expressions, but knowing when and how to use them will make you a much more efficient and marketable developer. You'll learn how regular expressions can be used for validating user input, parsing text, and refactoring code. We'll also cover various tools that can be used to help you write and share expressions.$
Oracle database supports perl- and POSIX-compatible regular expressions with five elegant and powerful functions: REGEXP_REPLACE, REGEXP_SUBSTR, REGEXP_INSTR, REGEXP_LIKE, and REGEXP_COUNT.
This session will demonstrate their nuances and how to use them effectively for data cleansing, manipulation and selection, for validating things such as Social Security Numbers, credit cards, IP addresses, phone numbers, DNAs, XMLs, for extracting things such as email-ids, hostnames from URLs and strings, and for transposing delimited columns to rows. There will be a demo of a few tricky examples taken from forums.oracle.com and asktom.oracle.com.
The session will end with fuzzy matching and optimization techniques, and things to watch out for.
http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_regexp.htm
Lection is one of the course "Discrete Mathematics." More detailed information about the programs of the Economic Cybernetics Department SumDU you could find here: https://ek.biem.sumdu.edu.ua/courses
Recognizing patterns in a sequence of rows has been a capability that was widely desired, but not possible with SQL until now. There were many workarounds, but these were difficult to write, hard to understand, and inefficient to execute. Beginning in Oracle Database 12c, you can use the MATCH_RECOGNIZE clause to achieve this capability in native SQL that executes efficiently. This presentation discusses how to do this.
This presentation by Morris Kleiner (University of Minnesota), was made during the discussion “Competition and Regulation in Professions and Occupations” held at the Working Party No. 2 on Competition and Regulation on 10 June 2024. More papers and presentations on the topic can be found out at oe.cd/crps.
This presentation was uploaded with the author’s consent.
Acorn Recovery: Restore IT infra within minutesIP ServerOne
Introducing Acorn Recovery as a Service, a simple, fast, and secure managed disaster recovery (DRaaS) by IP ServerOne. A DR solution that helps restore your IT infra within minutes.
This presentation, created by Syed Faiz ul Hassan, explores the profound influence of media on public perception and behavior. It delves into the evolution of media from oral traditions to modern digital and social media platforms. Key topics include the role of media in information propagation, socialization, crisis awareness, globalization, and education. The presentation also examines media influence through agenda setting, propaganda, and manipulative techniques used by advertisers and marketers. Furthermore, it highlights the impact of surveillance enabled by media technologies on personal behavior and preferences. Through this comprehensive overview, the presentation aims to shed light on how media shapes collective consciousness and public opinion.
0x01 - Newton's Third Law: Static vs. Dynamic AbusersOWASP Beja
f you offer a service on the web, odds are that someone will abuse it. Be it an API, a SaaS, a PaaS, or even a static website, someone somewhere will try to figure out a way to use it to their own needs. In this talk we'll compare measures that are effective against static attackers and how to battle a dynamic attacker who adapts to your counter-measures.
About the Speaker
===============
Diogo Sousa, Engineering Manager @ Canonical
An opinionated individual with an interest in cryptography and its intersection with secure software development.
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Orkestra
UIIN Conference, Madrid, 27-29 May 2024
James Wilson, Orkestra and Deusto Business School
Emily Wise, Lund University
Madeline Smith, The Glasgow School of Art
Have you ever wondered how search works while visiting an e-commerce site, internal website, or searching through other types of online resources? Look no further than this informative session on the ways that taxonomies help end-users navigate the internet! Hear from taxonomists and other information professionals who have first-hand experience creating and working with taxonomies that aid in navigation, search, and discovery across a range of disciplines.
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Regular expression
1.
2. A regular expression is a pattern that describes a set of strings.
WHY?
Regular expressions are used in many situation in computer programming.
Majorly in search, pattern matching, parsing, filtering of results and so on.
In lay man words, its a kind of rule which programmer tells to the computer to
understand.
You may see this in website forms, where you are only forced to enter ONLY
numbers or ONLY characters or MINIMUM 8 characters and so on, these are
controlled by REGEX behind the screen.
3. American mathematician credited for
inventing Regular Expressions in the
1950’s using a mathematic notation called
regular sets.
6. (0 + 1)* All strings of 0’s and 1’s
01* 0 followed by any number 1’s
0(0 + 1)* All strings of 0’s and 1’s, beginning with a 0
(0 + 1)*1 All strings of 0’s and 1’s, ending with a 1
7. Nondeterministic finite automaton with ε-moves (NFA-ε) is a further
generalization to NFA.This automaton replaces the transition function with the one
that allows the empty string ε as a possible input.The transitions without
consuming an input symbol are called ε-transitions.
12. In DFA, for each input symbol, one can determine the state to which the machine
will move. Hence, it is called Deterministic Automaton. As it has a finite number
of states, the machine is called Deterministic Finite Machineor Deterministic
Finite Automaton.
13. A Generalized Nondeterministic Finite Automaton is similar to an NFA but the
transition function takes a state and a regular expression in the alphabet instead of a
state and an alphabet element.
The idea is that in state q0 the transition to state q1 can be taken if the next input
matches the regular expression 1101.
14. A generalized nondeterministic finite automaton is a 5-tuple, (Q,∑, δ, qstart, qaccept),
where
Q is the finite set of states,
∑ is the input alphabet
δ : (Q - {qaccept} x (Q - { qstart }) → R is the transition function, where R is the set of all
regular expressions over ∑
qstart is the start state
qaccept is the accept state
15.
16. 1.Add a new start state and a new final state.
2. Add epsi transitions to the new states.
3. Remove 3
4. Link between 2 and f is now b
5. Remove 3
6. Add a new link between 2 and 2 with bb∪a as a lop.
7. Now link between 1 and 2 with ba.
8. Remove 2
9. Link 1 and f with (a∪b)(bb∪a)*b
10. Link s and f with ((a∪b)(bb∪a)*ba)*((a∪b)(bb∪a)*b)
This is the regular Expression from this NFA
17. CFG
WHAT IS CFG??
CFG MEANS CONTEXT –FREE GRAMMAR. IN FORMAL LANGUAGE THEORY, A CONTEXT-FREE GRAMMAR (CFG) IS A CERTAIN
TYPE OF FORMAL GRAMMAR: A SET OF PRODUCTION RULES THAT DESCRIBE ALL POSSIBLE STRINGS IN A GIVEN FORMAL LANGUAGE.
IN SIMPLE WORD IT’S A NOTATION OF DESCRIBING LANGUAGE.
[SOURCE : HTTPS://EN.WIKIPEDIA.ORG/WIKI/CONTEXT-FREEG_RAMMAR]
18. WHAT DOES CFG DO??
A CFG PROVIDES A SIMPLE AND MATHEMATICALLY PRECISE MECHANISM FOR DESCRIBING THE
METHODS BY WHICH PHRASES IN SOME NATURAL LANGUAGE ARE BUILT FROM SMALLER BLOCKS,
CAPTURING THE BLOCK STRUCTURE OF SENTENCES IN A NATURAL WAY.
20. AMBIGUOUS GRAMMAR
GENERALLY REPRESENT BY ( V T P S )
VARIABLE TERMINAL PRODUCTION START SYMBOL
EXAMPLE:
S- AB
A AA
HERE ,
A = TERMINAL
V = VARIABLE
21. DERIVATION
TWO TYPE OF DERIVATION:
1. LEFT-MOST DERIVATION:
SAB
DERIVATION START FROM THE LEFT SIDE VARIABLE.
2. RIGHT-MOST DERIVATION:
SAB
DERIVATION START FROM THE RIGHT SIDE VARIABLE.
23. EXAMPLE OF CFG
A REGULAR EXPRESSION THAT START AND END WITH SAME SYMBOL
A(A+B)*A + B(A+B)*B +A +B +Ε
L={AA, BB, ABA, ABBA, AABA, BAAAB……..}
HERE GRAMMAR IS:
S AAA|BAB|A|B|Ε
A AA|BA|Ε
FOR STRING AABA THE DERIVATION IS:
S AAA
AAAA
AABAA
AABΕAA
AABA
27. RegEx flavors are not consistent in implementation
WHY USE IT?
It makes changing large amounts of repetitive text trivial as long as you can see
patterns.
It makes you awesome in a geeky way.
29. Standard Characters
Letters: A to Z, a to z
Numbers: 0 to 9
Symbols: !, @, #, %, &, e.t.c.
Meta Characters
Special Characters: )(][^$.|?*+
To use those special characters escape them with blackslash
30. Matches one & only characters in a set of characters.
[Aa] matches either ‘A’ or ‘a’
[a-z] matches one lowercase letter among specified range
[^Aa] matches anything but ‘A; and ‘a’
31. d, [0-9] digits 0 t0 9
w, [da-zA-Z_] alphanumeric or _
s , [t(?:n|rn)] whitespace
33. Using a pipe | , match either the left or right side of the pattern.
(You | Me) matches a string that contains either
34. {n} Matches exactly n times
{n,} Matches n or more times
{n,m} Matches between n and m times
* Same as {0,1}
+ Same as {1,}
? Same as {0,1}
35. Matches positions instead of characters
^ matches beginning
$ matches end
b matches between token
36. Positive Lookahead
Iron(?=man) matches “Iron” if it is followed by “man”
Negative Lookahead
Iron(?!man) matches “iron” if it is not followed by “man”
Positive Lookbehind
(?<=Iron)man matches “man” if it is preceded by “Iron’
Negative Lookbehind
(?<!Iron)man matches “man” if it is not preceded by “Iron”
37. function isWeakPassword( $pwd ) {
$error = false;
if (strlen($pwd) < 8) {
$error = "Password Must be 8 Character
Long!";
}if (!preg_match("#[0-9]+#", $pwd)) {
$error = "Password must include at least
one number!";
}if (!preg_match("#[A-Z]+#", $pwd)) {
$error = "Password must include at least
one Upper Case letter!";
}
if (!preg_match("#[a-z]+#", $pwd)) {
$error = "Password must include at least
one lower case letter!";
} if(!preg_match('`[$*.,+-=@]`',$pwd))
$error = "Password must include a
symbol!";
return $error;
}