Tumgik
#Regular Expressions
yesterdays-xkcd · 10 months
Text
Tumblr media
Wait, forgot to escape a space. Wheeeeee[taptaptap]eeeeee!
Regular Expressions [Explained]
Transcript Under the Cut
[in a yellow box:] Whenever I learn a new skill I concoct elaborate fantasy scenarios where it lets me save the day.
Megan: Oh no! The killer must have followed her on vacation!
[Megan points to computer.] Megan: But to find them we'd have to search through 200 MB of emails looking for something formatted like an address! Cueball: It's hopeless!
Off-panel voice: Everybody stand back.
Off-panel voice: I know regular expressions.
[A man swings in on a rope, toward the computer.] tap tap
The word PERL! appears in a bubble.
[The man swings away, and the other characters cheer.
85 notes · View notes
cpunch71 · 11 months
Text
did you know Go's regex engine has a repetition limit? me either! that & more in my new journal entry :3
7 notes · View notes
dkl9 · 1 year
Text
Tumblr media
/energy*/, which matches "energ", "energy", "energyy", "energyyy", etc
(from AN #766)
2 notes · View notes
periwinklenya · 1 year
Text
okay i know no one really cares about this but me but if we could filter tags with regular expressions i would literally be so happy lol. like i don’t ever wanna see anything + “x reader” lol please let me filter good
1 note · View note
devleader · 29 days
Link
0 notes
intelliatech · 3 months
Text
Top 10 ChatGPT Prompts For Software Developers
Tumblr media
ChatGPT can do a lot more than just code creation and this blog post is going to be all about that. We have curated a list of ChatGPT prompts that will help software developers with their everyday tasks. ChatGPT can respond to questions and can compose codes making it a very helpful tool for software engineers.
While this AI tool can help developers with the entire SDLC (Software Development Lifecycle), it is important to understand how to use the prompts effectively for different needs.
Prompt engineering gives users accurate results. Since ChatGPT accepts prompts, we receive more precise answers. But a lot depends on how these prompts are formulated. 
To Get The Best Out Of ChatGPT, Your Prompts Should Be:
Clear and well-defined. The more detailed your prompts, the better suggestions you will receive from ChatGPT.
Specify the functionality and programming language. Not specifying what you exactly need might not give you the desired results.
Phrase your prompts in a natural language, as if asking someone for help. This will make ChatGPT understand your problem better and give more relevant outputs.
Avoid unnecessary information and ambiguity. Keep it not only to the point but also inclusive of all important details.
Top ChatGPT Prompts For Software Developers
Let’s quickly have a look at some of the best ChatGPT prompts to assist you with various stages of your Software development lifecycle.
1. For Practicing SQL Commands;
Tumblr media
2. For Becoming A Programming Language Interpreter;
Tumblr media
3. For Creating Regular Expressions Since They Help In Managing, Locating, And Matching Text.
Tumblr media
4. For Generating Architectural Diagrams For Your Software Requirements.
Prompt Examples: I want you to act as a Graphviz DOT generator, an expert to create meaningful diagrams. The diagram should have at least n nodes (I specify n in my input by writing [n], 10 being the default value) and to be an accurate and complex representation of the given input. Each node is indexed by a number to reduce the size of the output, should not include any styling, and with layout=neato, overlap=false, node [shape=rectangle] as parameters. The code should be valid, bugless and returned on a single line, without any explanation. Provide a clear and organized diagram, the relationships between the nodes have to make sense for an expert of that input. My first diagram is: “The water cycle [8]”.  
Tumblr media
5. For Solving Git Problems And Getting Guidance On Overcoming Them.
Prompt Examples: “Explain how to resolve this Git merge conflict: [conflict details].” 6. For Code generation- ChatGPT can help generate a code based on descriptions given by you. It can write pieces of codes based on the requirements given in the input. Prompt Examples: -Write a program/function to {explain functionality} in {programming language} -Create a code snippet for checking if a file exists in Python. -Create a function that merges two lists into a dictionary in JavaScript.  
7. For Code Review And Debugging: ChatGPT Can Review Your Code Snippet And Also Share Bugs.
Prompt Examples: -Here’s a C# code snippet. The function is supposed to return the maximum value from the given list, but it’s not returning the expected output. Can you identify the problem? [Enter your code here] -Can you help me debug this error message from my C# program: [error message] -Help me debug this Python script that processes a list of objects and suggests possible fixes. [Enter your code here]
8. For Knowing The Coding Best Practices And Principles: It Is Very Important To Be Updated With Industry’s Best Practices In Coding. This Helps To Maintain The Codebase When The Organization Grows.
Prompt Examples: -What are some common mistakes to avoid when writing code? -What are the best practices for security testing? -Show me best practices for writing {concept or function} in {programming language}.  
9. For Code Optimization: ChatGPT Can Help Optimize The Code And Enhance Its Readability And Performance To Make It Look More Efficient.
Prompt Examples: -Optimize the following {programming language} code which {explain the functioning}: {code snippet} -Suggest improvements to optimize this C# function: [code snippet] -What are some strategies for reducing memory usage and optimizing data structures? 
10. For Creating Boilerplate Code: ChatGPT Can Help In Boilerplate Code Generation.
Prompt Examples: -Create a basic Java Spring Boot application boilerplate code. -Create a basic Python class boilerplate code
11. For Bug Fixes: Using ChatGPT Helps Fixing The Bugs Thus Saving A Large Chunk Of Time In Software Development And Also Increasing Productivity.
Prompt Examples: -How do I fix the following {programming language} code which {explain the functioning}? {code snippet} -Can you generate a bug report? -Find bugs in the following JavaScript code: (enter code)  
12. Code Refactoring- ChatGPt Can Refactor The Code And Reduce Errors To Enhance Code Efficiency, Thus Making It Easier To Modify In The Future.
Prompt Examples –What are some techniques for refactoring code to improve code reuse and promote the use of design patterns? -I have duplicate code in my project. How can I refactor it to eliminate redundancy?  
13. For Choosing Deployment Strategies- ChatGPT Can Suggest Deployment Strategies Best Suited For A Particular Project And To Ensure That It Runs Smoothly.
Prompt Examples -What are the best deployment strategies for this software project? {explain the project} -What are the best practices for version control and release management?  
14. For Creating Unit Tests- ChatGPT Can Write Test Cases For You
Prompt Examples: -How does test-driven development help improve code quality? -What are some best practices for implementing test-driven development in a project? These were some prompt examples for you that we sourced on the basis of different requirements a developer can have. So whether you have to generate a code or understand a concept, ChatGPT can really make a developer’s life by doing a lot of tasks. However, it certainly comes with its own set of challenges and cannot always be completely correct. So it is advisable to cross-check the responses. Hope this helps. Visit us- Intelliatech
0 notes
Text
I am a little confused why I never hear about regex libraries compiling regexes to a list of function pointers.
From my naive initial think at the problem, seems like you could save a lot of branches that way; a good middle ground between
the usual approach of compiling to an intermediate representation which is only more-efficiently interpreted, and
the heavyweight approach of JIT-compiling the regex to actual machine code.
1 note · View note
javatpoint · 7 months
Text
Demystifying Regular Expressions in Java: A Comprehensive Guide
What are Regular Expressions in Java? Regular expressions, often abbreviated as regex, are powerful tools used for pattern matching and string manipulation in Java programming. In this article, we’ll delve into the world of regular expressions in Java, exploring how they work, how to use them effectively, and providing a handy regex cheat sheet for quick reference. Understanding Regular…
View On WordPress
0 notes
windsails · 7 months
Text
my beautiful child regular expression
1 note · View note
megaloxanthem · 11 months
Text
Tumblr media
Check out this hexagonal regex crossword by Dan Gulotta and Palmer Mebane!
Source: https://devjoe.appspot.com/huntindex/puzzle/mit2013601
0 notes
codingchica · 1 year
Text
Regular Expressions Basics
Regular expressions can be used in Java via the Pattern and Matcher classes to validate input formats or parse part of a string out of a larger string. #java #regExp #regularExpressions #pattern #matcher #syntax
Table of Contents Table of ContentsIntroductionUse CasesPredefined Character ClassesCustom Character ClassesGreedy CountsAdditional KeywordsLogical OperatorsInvokingCapturing GroupsHelpful FlagsExamplesSummary Introduction When consuming String inputs, we may need to search within that string to see if part or all of it matches a pattern in order to determine that it is valid, or to extract or…
Tumblr media
View On WordPress
1 note · View note
Text
python split a word into syllables
import re # https://pythonprogrammingsnippets.tumblr.com def split_into_syllables(word): # Remove non-alphabetic characters word = re.sub('[^a-zA-Z]', '', word) # Define some common prefixes and suffixes that affect syllable splitting prefixes = ['pre', 'post', 'ante', 'anti', 'bi', 'tri', 'uni'] suffixes = ['esque', 'able', 'less', 'ment', 'ness', 'tion', 'sion', 'al', 'ous', 'ive', 'ful'] # Initialize a list to hold the syllables syllables = [] # Split the word into parts based on prefixes and suffixes for prefix in prefixes: if word.startswith(prefix): syllables.append(prefix) word = word[len(prefix):] break for suffix in suffixes: if word.endswith(suffix): word = word[:-len(suffix)] syllables.append(suffix) break # Split the remaining word into syllables using regex # This pattern splits words into syllables based on vowel sounds and consonant clusters pattern = re.compile('[^aeiouy]*[aeiouy]+(?:[^aeiouy]*$|[^aeiouy](?=[^aeiouy]))?') syllables += pattern.findall(word.lower()) return syllables
0 notes
devleader · 1 month
Link
0 notes
officialkrubs · 2 years
Text
regex game
0 notes
foxylovey · 6 months
Text
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Various jrwi sketches in my fun alternative style to warm up
646 notes · View notes
bonsiii-art · 11 days
Note
a3 or a4 with wildberry cookie? PLEASE I NEED WILDBERRY CONTENT THERE'S NOT ENOUGH 😭 (also your art is lovely asjdjj heart emoji)
Tumblr media
What's on your mind, 'berry my boy? :P
(thank you, anon, I'm glad you like my work! uwu)
327 notes · View notes