+ 4
[SOLVED]What is the re module used for in python?
9 odpowiedzi
+ 4
regex operations. finding patterns etc .
+ 6
Markus Kaleton that's all it does? ok
+ 5
Jordan oh cool!
+ 1
You could almost say regex is a programming language by itself. really useful.
More to read:
https://docs.python.org/3/howto/regex.html
+
re module docs
+ 1
You can use it to process strings. I've seen it described as ctr + f on steroids. Except you can customize exactly what, how, and where to look for it.
+ 1
For example I use it in my chess engine (current version not yet posted here) to analyze the notation for a move. It validates that the note is of the proper format, then uses the various parts of it to construct a Move object based on the information provided. I believe I also use it when making new Piece objects. I just pass a string to the Player class and it pulls it apart, identifies the type of Piece to create and the position to create it at.
+ 1
LONGTIE Sure, what'cha got?