0

Python meta characters

pattern1 = r"[^A-Z]" pattern2 = r"^gray" I don’t understand why these " ^ " mean different. Is this because one of them is used inside [] ? Is there any other meta characters used like this? Please help me.

15th Mar 2019, 9:01 AM
Yă‚œăƒŒă‚»ăƒŒă‚ž
Yă‚œăƒŒă‚»ăƒŒă‚ž - avatar
2 Réponses
+ 6
Yep. When it's inside the square brackets, it'll match for not having what follows carate( ^ ) in the given string. In this case it'll match everything other than A-Z characters bcz of "[^A-Z]" which means not A-Z.
15th Mar 2019, 9:12 AM
йащо Đ Đ°ĐœĐ¶Đ°Đœ
йащо Đ Đ°ĐœĐ¶Đ°Đœ - avatar
0
thanks for your explanation!
17th Mar 2019, 5:34 AM
Yă‚œăƒŒă‚»ăƒŒă‚ž
Yă‚œăƒŒă‚»ăƒŒă‚ž - avatar