All Questions
Tagged with regex validation
33 questions
2
votes
1
answer
134
views
Newspaper Bill Calculator CLI with Python (1 of 3, Core)
Code is posted after explanation.
Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused.
Post 2 of 3, CLI: Newspaper Bill ...
7
votes
5
answers
179
views
readable validation with python regex and simple logic
I have come with such a code for checking IP addresses. But would like to know how clean and good it is from 1 to 10. What I care about are readability and simplicity. Please give me any feedback.
...
2
votes
1
answer
113
views
Validator and Sanitizer for HTML 5 attribute regex according to current HTML living standard
According to https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 an HTML 5 attribute name is defined like this:
Attribute names must consist of one or more characters other than
controls, ...
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?
...
2
votes
0
answers
104
views
Sanitize input for a "robot on a grid" kata
I have the following piece of code which is FSI tested and works.
However, I want to trim it as much as possible (not only the comments, which are there for my own future reference) and make it as ...
2
votes
2
answers
125
views
Manipulate urls with regular expressions instead of the slip approach
Basically I have an url which looks like this structurally speaking:
http://www.my-site.com/topic1/topic2/topic3/topic4/topic5
and I want to do 2 things to it:
<...
3
votes
1
answer
2k
views
Validate URL with Regex and java.net.URL
I'm writing a URL validator. Firstly, it checks for special characters in the input. Secondly, it adds 'http://' and checks for validity.
...
5
votes
1
answer
2k
views
Regex XML validator
I have written a Regex to validate XML/HTML, along with any attributes. It aims to:
Match any XML-like text
Not match any unclosed tags
Adapt for any spacing, newlines, etc.
Be as generous as possible:...
3
votes
2
answers
178
views
Checking the strength of a password using regexes
I'm a beginner in Python and I made a password checker. I'm following these rules:
I have to use regex
password must be at least 8 characters
must have at least one lower case character
must have at ...
2
votes
1
answer
223
views
Checking if an object meets certain criteria to amend to certain Entity Objects?
I am trying to check if a class has only numeric values in it and then return a bool, however, some instances there may be non numeric chars in an object that ...
4
votes
1
answer
3k
views
Swedish 'Personnummer' validator
I have a small C# program that validates Swedish social security numbers ('Personnummer').
I chose to use Regex as there are many different ways it can be input.
...
2
votes
1
answer
1k
views
Form validation function for React
I need to validate multiple input fields using React. I am using a simple if-else block for each input field but I would like to optimize my code and make it better. I feel there can be a better way ...
2
votes
1
answer
215
views
Check values in datatables, with validation rules that vary according to the data source
Background
I receive dataframes from several sources (below I call these sources s1, s2 and ...
2
votes
2
answers
919
views
Validate Email as User is typing (JavaScript)
I have the following javascript function validateEmail(value). The goal of the function is to validate the users inputted email as they are typing. So if someone puts nfg@*gmail.com the email will be ...
2
votes
1
answer
43
views
Finding incorrect yml headers
Introduction
I am working on a semi large project with a few hundred files. In this project there is a series of lesson.yml files I want to check is formatted correctly. And, yes, every file I want ...