All Questions
Tagged with regex python-2.x
22 questions
1
vote
2
answers
830
views
Python Regex to validate an email
I have written this regex to validate an email. It seems to work fine. Can someone advise on the regex used? Does it work properly or can be done in a better way?
...
1
vote
1
answer
92
views
Replace characters using multiple dependent regular expression substitutions
I've written the following Python module to iterate over field values in the following two fields: "NAME_LABEL", "CATEGORY". I'm using regular expressions in the following function: "...
-1
votes
1
answer
257
views
Decoding a string encoded by Caesar Cipher and some delimiters [closed]
I have the following code which I seek to optimize. The result of the bruteforce I already have but I'm just trying to learn some more python using the same example.
The code in the data needs to be ...
5
votes
1
answer
922
views
Python: wild card pattern matching with memoization
Here is my take on wild card pattern matching with memoization.
I would appreciate comments on clarity of the code, as well as suggested ways to improve readability and maintainability (for bigger ...
2
votes
0
answers
261
views
Convert python's strftime directives to user-friendly format examples
I'm converting python's very un user-friendly strftime date time directives to user-friendly formats so that users of an API will know how to format a date if they send an invalid format.
My thinking ...
13
votes
1
answer
465
views
Voting plugin for an IRC bot
MetaBrainz has an IRC channel called #metabrainz on which there's a bot called BrainzBot running. It provides utilities such as linking to JIRA issues or Github PRs ...
7
votes
2
answers
5k
views
Using python and beautifulsoup to iterate through a list of websites to find a particular string
I'm attempting to find companies who mention a particular service in on their homepage. To do this, I am iterating through a csv file with two columns - ID and URL. I'm using BeautifulSoup to get the ...
8
votes
1
answer
5k
views
Python hash verification tool
I wanted to better understand regular expressions, however, just learning regular expressions would be extremely boring. So I created a simple little program that will verify a hash by the length and ...
8
votes
2
answers
2k
views
Python traverse a directory recursively and print contact numbers
I am writing a python code to recursively traverse a directory containing only text files and then print the 10 digit Indian phone number and all its variants. I am very new to python and I have ...
7
votes
3
answers
727
views
Find all needles in the haystack and return their sum
This is based on a programming challenge I recently solved. However, since the writer of the challenge asked me not to disclose the question and/or it's answer, I modified it a little. If it doesn't ...
1
vote
1
answer
342
views
Pokemon search engine
I am making a simple function to find and match any possibilities what Pokémon the user wants. This is accomplished by taking in the input (what the user thinks the Pokémon is named) and compare its ...
7
votes
1
answer
78
views
Python App that parses file for lines that match a format
I recently wrote some code that was dinged on not having well defined tests and poor modularity. Was hoping someone could review my code and give me pointers on how to create more well-defined tests (...
1
vote
2
answers
1k
views
Matching lines in a CSV file with items in a dictionary
I was wondering if there was a better way of writing this...
I have a CSV file (about 6640 lines). After reading through the file, the values for the DFN_Network ...
5
votes
1
answer
437
views
Using Pandas to parse adwords export
I did this exercise yesterday mostly as practice, but it has some utility as well in day to day. I was basically attempting to take a string that looked like the following:
...
10
votes
2
answers
226
views
Get Wikimedia attributions for images
We are using images from Wikimedia commons for some of Cardshifter's game artwork. I selected some art for each card to make a .jpg file to use in the game clients, ...