Informatics1-2018/HW3

A MathWikiből
(Változatok közti eltérés)
(Új oldal, tartalma: „= Regex = == Names == The task is to find names with regex. A name can contain only latin (english) characters, it must start with an uppercase letter, the others are l…”)
 
a
 
12. sor: 12. sor:
 
     Donald J. Trump
 
     Donald J. Trump
 
     J. F. Kennedy
 
     J. F. Kennedy
 +
    Madonna
  
 
You can try it on a wikipedia article.
 
You can try it on a wikipedia article.
30. sor: 31. sor:
 
   Trump
 
   Trump
 
   Kennedy
 
   Kennedy
 +
  Madonna
  
 
== Points ==
 
== Points ==

A lap jelenlegi, 2018. október 3., 11:28-kori változata

Tartalomjegyzék

Regex

Names

The task is to find names with regex. A name can contain only latin (english) characters, it must start with an uppercase letter, the others are lowercase. There can be several parts of the name separated by space, it can contain abbreviated names: a capital letter and a dot, but not as the last name.

Examples:

   Paul Erdos
   Gabor Kiraly 
   Maria Gaetana Agnesi
   Donald J. Trump
   J. F. Kennedy
   Madonna

You can try it on a wikipedia article.

Counter examples, the followings do not count as names:

   paul erdos
   Gabor K.
   John von Neumann
   Abraham deMoivre

Substitution

Write a substitution rule that replaces the found names with the last name only:

  Erdos
  Kiraly
  Agnesi 
  Trump
  Kennedy
  Madonna

Points

The maximum point is 3 for this homework.

Deadline

2018.10.07 23:59

Send the regex and substitution string from your math account to info1hazi@gmail.com with a subject specified in the Informatics1-2018#Rules. You don't have to attach any file, just write the regex in the email.

Személyes eszközök