Sorting Login Information
Nicholas Wetzel last edited by
I am working on sorting a list of my login information.
My website password requirements: 8 characters or longer, not the same as the e-mail before the separator, and it must contain at least three of the following options: Number, Uppercase Letter, Lowercase Letter, or Special Character [ ! @ # $ % \ ] <-- special characters inside brackets.
I am just unsure of how to do this, help is appreciated. :)
Example of lines I want to keep:
Examples of lines I want to delete:
PeterJones last edited by
Off the top of my head, I cannot think of anything regex that would match “this substring does not contain at least 3 of the 4 required character classes”. That’s as much as I can tell you for now.
As I explained to you in your previous thread:
This forum is formatted using Markdown, with a help link buried on the little grey
?in the COMPOSE window/pane when writing your post. For more about how to use Markdown in this forum, please see @Scott-Sumner’s post in the “how to markdown code on this forum” topic, and my updates near the end. It is very important that you use these formatting tips – using single backtick marks around small snippets, and using code-quoting for pasting multiple lines from your example data files – because otherwise, the forum will change normal quotes (
"") to curly “smart” quotes (
“”), will change hyphens to dashes, will sometimes hide asterisks (or if your text is
c:\folder\*.txt, it will show up as
c:\folder*.txt, missing the backslash). If you want to clearly communicate your text data to us, you need to properly format it.
If you have further search-and-replace (“matching”, “marking”, “bookmarking”, regular expression, “regex”) needs, study this FAQ and the documentation it points to. Before asking a new regex question, understand that for future requests, many of us will expect you to show what data you have (exactly), what data you want (exactly), what regex you already tried (to show that you’re showing effort), why you thought that regex would work (to prove it wasn’t just something randomly typed), and what data you’re getting with an explanation of why that result is wrong. When you show that effort, you’ll see us bend over backward to get things working for you. If you need help formatting, see the paragraph above.
Please note that for all regex and related queries, it is best if you are explicit about what needs to match, and what shouldn’t match, and have multiple examples of both in your example dataset. Often, what shouldn’t match helps define the regular expression as much or more than what should match.
You apparently only noticed (or took to heart) the third paragraph – which is more than many people show, so congrats on a 33% victory. However, the other two were important as well. Since you have not used any of the markdown advice to make it easier for us to understand what your real data is, and since you have not shown what you already tried (ie, you’ve showed no effort, either in this particular or learning regex in general), it is beginning to appear that you think of us as a free code-writing service, which we are not. If you show more effort, I might spend some energy coming up with an idea for how it might be done… (but, like I said, I don’t have any immediate ideas)
Alan Kilborn last edited by
Peter wrote (and copied) a lot. I can write a lot fewer:
This is a job for programming, not Notepad++.