Python Forum
Check for funny characters with a regexp
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check for funny characters with a regexp
#2
The problem is that I and S belong to the uppercase version of the character sequence
>>> s = "ā㥹ĆćČčĎďĐđēĕĖėęěĞğġīįİıĽľŁłŃńņňŋŌōőŒœŕřŚśŞşŠšŢţťŧũūŮűųŹźŻżŽžſ"
>>> s.upper()
'ĀĂĄĄĆĆČČĎĎĐĐĒĔĖĖĘĚĞĞĠĪĮİIĽĽŁŁŃŃŅŇŊŌŌŐŒŒŔŘŚŚŞŞŠŠŢŢŤŦŨŪŮŰŲŹŹŻŻŽŽS'
>>> 'I' in s.upper()
True
>>> 'S' in s.upper()
True
You could perhaps work without the case insensitive regex flag. It would be a good idea to compare with what Perl tells you about the uppercase version of the sequence.
Reply


Messages In This Thread
RE: Check for funny characters with a regexp - by Gribouillis - Jan-18-2020, 11:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I check if the first X characters of a string are numbers? FirstBornAlbratross 6 1,787 Apr-12-2023, 10:39 AM
Last Post: jefsummers
  Remove escape characters / Unicode characters from string DreamingInsanity 5 14,464 May-15-2020, 01:37 PM
Last Post: snippsat
  Check for a special characters in a column and flag it ayomayam 0 2,134 Feb-12-2020, 03:04 PM
Last Post: ayomayam
  RegExp: returning 2nd loop in new document syoung 5 4,179 May-02-2018, 12:36 PM
Last Post: syoung
  check if value of passed variable has uppercase characters in it. wfsteadman 3 3,384 Sep-01-2017, 05:52 PM
Last Post: metulburr
  Regexp that won't match anything Ofnuts 4 4,287 Mar-17-2017, 02:48 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020