Regular Expressions MAKING POWERFUL REGULAR CHANGES DESCRIBED BY EXPRESSIONS.

Slides:



Advertisements
Similar presentations
How data is stored. Data can be stored in paper-based systems including: Reference books Dictionaries Encyclopaedias Directories Index Files Filing systems.
Advertisements

Session 3BBK P1 ModuleApril 2010 : [#] Regular Expressions.
Microsoft® Access® 2010 Training
Regular Expressions BKF03 Brian Ciccolo. Agenda Definition Uses – within Aspen and beyond Matching Replacing.
DATABASE BASICS: INSERTING AND FORMATTING DATA EXCEL 07 SESSION II.
Introduction to FX Equation 4. The Basic Idea FX Equation is DIFFERENT. Most equation editors use a point and click interface that has you searching for.
Jeopardy Objects Navigation Buttons True/False Parts of a Report Vocabulary Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final.
Enter question text... 1.Enter answer text.... Enter question text... 1.Enter answer text...
Reports MLA Style.
Enter question text... 1.Enter answer text.... Enter question text... 1.Enter answer text...
Chapter 2 Creating a Research Paper with Citations and References
COMPREHENSIVE ICT Document Preparation System Mr.S.Sajiharan Computer Unit Faculty of Arts and Culture South Eastern University of Srilanka.
1 ADVANCED MICROSOFT POWERPOINT Lesson 5 – Using Advanced Text Features Microsoft Office 2003: Advanced.
Annotation & Nomenclature By Corey Fortezzo for PG&G GIS Workshop, 2010.
CS 497C – Introduction to UNIX Lecture 31: - Filters Using Regular Expressions – grep and sed Chin-Chih Chang
This Presentation Contains Narration To hear the narration, turn on your speakers or plug in headphones. If you would like to view this slideshow WITHOUT.
CHAPTER © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 4 Entering Patient Information.
Key Applications Module Lesson 12 — Word Essentials
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
Word Tutorial 3 Creating a Multiple-Page Report
Word Processing basics
Relex Reliability Software “the intuitive solution!” Relex Software Corporation 1.
1 Lab Session-III CSIT-120 Fall 2000 Revising Previous session Data input and output While loop Exercise Limits and Bounds Session III-B (starts on slide.
MLA Reports and Outlines. Class Activity On Your Handout: Identify the parts of the Word Window that you know –Either the name of the item or what it.
Chapter 2 Creating a Research Paper with References and Sources
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
CARLSON SOFTWARE CONFERENCE DANIEL V. SYPERSMA VICTOR GRAPHICS.
By the end of this session you should be able to...
Here are the main points:  use the words SEARCH, SORT and REPORT (report = a print out, sometimes called a hard copy)  mention the names of the fields.
Microsoft ® Office Access ™ 2007 Training Datasheets I: Create a table by entering data ICT Staff Development presents:
 Agenda 2/20/13 o Review quiz, answer questions o Review database design exercises from 2/13 o Create relationships through “Lookup tables” o Discuss.
How to check the equivalence of two regular expressions using JFLAP One of the questions in the previous HW involved converting an NFA to a regular expression.
Fractions  Fractions are a way of showing a portion of material compared with the whole thing.  E.g. ½ Pizza, half time, 1/3 off.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
FIRST COURSE Word Tutorial 3 Creating a Multiple-Page Report.
Copyright 2007, Paradigm Publishing Inc. WORD 2007 Chapter 5 BACKNEXTEND 5-1 LINKS TO OBJECTIVES Section Breaks Columns Hyphenation Drop Caps Insert Symbols,
CS 111 – Sept. 1 Intro to data representation Binary numbers –Convert binary  decimal –Convert decimal  binary Text –ASCII and Unicode Commitment: –For.
Writing about poetry in the exam
Validation final steps Stopping gaps being entered in an input.
Chapter 3 Automating Your Work. It is frustrating when you have to type the same passage of text repeatedly. For example your name and address. Word includes.
start The first step in the word application Add the word linked between the words or and information in the first line of the text. Add the word linked.
Unit 3: Text, Fields & Tables DT2510: Advanced CAD Methods.
What do you know about MLA? Memes To Get Us Thinking…
Microsoft Access Prepared by the Academic Faculty Members of IT.
Part II: Frequently asked NIALMS database questions l How do I move an existing recorder to a new customer? l How to replace a recorder for an existing.
Pasewark & Pasewark 1 Word Lesson 7 Working with Documents Microsoft Office 2007: Introductory.
Prepared by Ben Jarrett and Danielle Smyre of the IUP Applied Research Lab.
GCSE ICT How data is stored. How is data stored? Data can be stored in paper-based systems including: –Reference books –Dictionaries –Encyclopaedias –Directories.
ICS611 Lex Set 3. Lex and Yacc Lex is a program that generates lexical analyzers Converting the source code into the symbols (tokens) is the work of the.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Lesson 17 Mail Merge. Overview Create a main document. Create a data source. Insert merge fields into a main document. Perform a mail merge. Use data.
Key Applications Module Lesson 12 — Word Essentials Computer Literacy BASICS.
Regular Expressions In Javascript cosc What Do They Do? Does pattern matching on text We use the term “string” to indicate the text that the regular.
CHAPTER © 2013 The McGraw-Hill Companies, Inc. All rights reserved. 4 ENTERING PATIENT INFORMATION.
Advanced Regular Expressions
Nelson Mandela Quotes.
Intro to PHP & Variables
Query Languages.
MODULE 7 Microsoft Access 2010
Unit 1: Introduction Lesson 1: PArts of a java program
General Works Cited Formatting
Benchmark Series Microsoft Word 2016 Level 2
Signature: Microsoft Word 2003
Microsoft OneNote.
Lesson 3: Find and Replace Tools

Freshman Project - Final Draft

Presentation transcript:

Regular Expressions MAKING POWERFUL REGULAR CHANGES DESCRIBED BY EXPRESSIONS

Examples from last year Find all of the verse numbers ◦ \\v \d* Find any text following a section heading ◦ \\s1 (.*)\r\n Find any punctuation at the end of the field ◦ \\\w+ (.*)[\\.:;,!] Change all the word final t ◦ t\b Find all hyphenated words ◦ \w+(-\w+)+

Objectives  Revise basic RegEx alphabet  Identify suitable RegEx to perform several common dictionary database tasks  Assignment – write several RegEx to cleanup dictionary conversion

Revise basic RegEx alphabet SymbolMeaning.any character \ turn special character back to normal character ^beginning of line, NOT *0 or more +one or more $end of line [ ]set { }repetitions ( )store in a group use \0 \1 \2 \3 … \9 to recall |OR ?optional, lazy \dnumbers \swhite space (spaces, tabs, enter) \wword building characters \bword break \uxxxxUnicode character xxxx

RegEx - dictionary tasks Will work through Primer 2 tasks 1-7  Program - text editor for regular expressions o (SetupEditPadLite.exe)  Datafile Dict_Baat-U.sfm.txt

Task 1 – check ordering of markers Find all \hm markers which are not immediately after \lx. ◦What is the \hm marker: \\hm.*\r\n ◦What should be above it? \\lx.* \r\n ◦What shouldn't be above it? \\[^l] Now try it! Answer: \\[^l].*\r\n\\hm.*\r\n

Task 2 – reorder markers Move the \hm marker so that it is directly after the \lx. ◦We found the misplaced \hm markers in the previous task. ◦Now we need to move the \hm to be above it, that is change the order of the markers. ◦But we need to store the text first. Answer: Find: (\\[^l].*\r\n)(\\hm.*\r\n) Replace: \2\1

Task 3 – using NOT Find a new line which doesn't begin with an SFM marker. ◦What is a new line? _____ What is NOT? ___ ◦What does a SFM marker begin with? ___ Answer: \r\n[^\\]

Task 4 – convert straight quotes to curved quotes Convert straight quotes used at the opening and closing of quotations to angled (curved) quotes. ◦This is identical to the task in Primer 1 (for Paratext).

Task 5 – changing markers Change all \pn markers to \ps. This is identical to a task in Primer 1 (for Paratext) and can also be done with a normal search/replace.

Task 6 - check ordering of markers Make sure all \lc are directly after either \lx or \hm if it exists. ◦This is very similar to task 1.

Task 7 – change text Change word final 't' to 'ɗ'. ◦This is identical to a task in Primer 1 for Paratext. ◦Note: only word final 't' and not the others.

3. Assignment See Assignments RegEx