The regular-expressions tag has no wiki summary.
0
votes
0answers
6 views
How can I capture data using regular expressions in Ruby? [closed]
How could I capture just everything before the underscore using regular expressions for the following group of strings? These strings are in an element of an array.
"FBXW7_NM_018315_2"
"PTEN"
...
-1
votes
0answers
41 views
Python: Single Quotes Showing up in my Database [migrated]
I'm doing some python programming, inserting data into a MYSQL database for a project. I've been doing the coding, but noticed an odd artifact; Whenever I insert string data, my database includes the ...
-4
votes
1answer
72 views
Most common regex elements [closed]
I have been thinking about a regex tool for beginners. However, regex is a big language with lots of dialects and little tips'n'tricks. Arguably, many of these are unnecessary for a beginner.
I ...
0
votes
0answers
14 views
how to do vi search and replace in sublime text [migrated]
I enabled vintage mode on sublime text.. but there are some important vim commands that are lacking.. so let's say I want to do a search and replace like so
:10,25s/searchedText/toReplaceText/gc
...
45
votes
10answers
3k views
Readable regular expressions without losing their power?
Many programmers know the joy of whipping up a quick regular expression, these days often with help of some web service, or more traditionally at interactive prompt, or perhaps writing a small script ...
5
votes
3answers
196 views
Constructing a Finite State Automaton
I have an exam question that I am unsure of the answer. The question is:
In organisation X valid user names have the following structure. The
user name can be either the employee’s name followed ...
3
votes
1answer
364 views
Constructing a Deterministic Finite State Automaton for a given Regex
I have a couple of exam questions for my compilers class and wanted to check if my solutions are correct.
The first question is:
Consider a language in which numbers start with an optional minus
...
-1
votes
2answers
149 views
Can non-IT people learn and take advantage of regular expressions? [closed]
Often times, not-IT people has to deal with massive text data, clean it, filter it, modify it. Often times normal office tools like Excel lack the tools to make complex search and replace operations ...
2
votes
1answer
80 views
String patterns that can be used to filter and group files
One of our application filters files in certain directory, extract some data from it and export a document from the extracted data. The algorithm for extracting the data depends on the file, and so ...
14
votes
2answers
785 views
Are regular expressions a programming language?
In the academic sense, do regular expressions qualify as a programming language?
The motivation for my curiosity is an SO question I just looked at which asked "can regex do X?" and it made me wonder ...
2
votes
2answers
108 views
What is the best strategy for transforming unicode strings into filenames?
I have a bunch (thousands) of resources in an RDF/XML file. I am writing a certain subset of the resources to files -- one file for each, and I'm using the resource's title property as the file name. ...
5
votes
2answers
220 views
Python flavor of regular expressions - related to which?
So my copy of the classic book, Mastering Regular Expressions, just arrived, and I'm scanning through it. The cover (third edition) says, "for Perl, PHP, Java, .NET, Ruby, and More!" Well, it does ...
4
votes
2answers
259 views
Why does Java define homogeneous methods in Matcher and Pattern classes
I wonder why java defines homogeneous methods in two distinct classes: java.util.regex.Pattern and java.util.regex.Matcher.
For example split method defined in Pattern class and replaceAll method ...
62
votes
23answers
9k views
Is it a must for every programmer to learn regular expressions?
I am new to programming, and at an interview I got a question on regular expressions; needless to say I couldn't answer. So I was wondering whether I should learn regular expression? Is it a must for ...
8
votes
7answers
2k views
How do regular expressions actually work?
Say you have a document with an essay written. You want to parse this essay to only select certain words. Cool.
Is using a regular expression faster than parsing the file line by line and word by ...
12
votes
10answers
714 views
Inspiring problems to show off the importance of regular expressions?
I am planning to give a presentation/demonstration on regular expressions at work to encourage young developers to add this powerful and important tool in their toolbox.
Just teaching syntax doesn't ...
22
votes
4answers
2k views
When you should NOT use Regular Expressions?
Regular expressions are powerful tool in programmer's arsenal, but - there are some cases when they are not a best choice, or even outright harmful.
Simple example #1 is parsing HTML with regexp - a ...
76
votes
18answers
4k views
How do you learn Regular Expressions?
I'm not asking where to learn. I've found lots of good resources online, and books etc.
But how the heck do I tackle them. Where is the start of it, the end? When does the regexp processor advance on ...
0
votes
2answers
246 views
Documentation often ommits to specify which flavour of regular expression to use, so is there a default flavour that we should all be familiar with?
Often I come across documentation that says "use a regular expression here" I have to spend quite some time digging around trying to work out which regular expression format they are expecting.
As ...
5
votes
11answers
1k views
Decent tool for building and testing regular expressions [duplicate]
I'm in need of a decent tool for building and testing regular expressions, what does everyone use?
I would download expresso but in my last place it turned out to be laden with adware - any clean ...
7
votes
10answers
734 views
A better way of doing Regex? [duplicate]
I really dislike regular expressions, each time I come back to it I seem to have to relearn it. It's also incredibly hard to maintain, modify and at a glance understand what it is doing.
Has anyone ...
12
votes
6answers
393 views
What can / should be done with regular expressions?
I've recently learnt regular expressions and I love writing / using them. I'm looking for ideas and more opportunities to use them, however I don't want to overuse them as an all purpose tool, as ...
3
votes
1answer
642 views
can a regex search engine for the web be done and if so, how?
I think it would be a great idea if we had a regular expression search engine, but can it be done? It seems impossible since there's no feasible way of indexing such a huge amount of data properly and ...
23
votes
17answers
2k views
Why are regular expressions so morbidly attractive?
Exhibit 1, Exhibit 2, I guess you won't find it hard to recall other examples.
Thing is: if there is more than one way to solve a problem, the PHP programmer (I usually browse the PHP tag on ...
0
votes
2answers
224 views
Regexp or custom parsing algo?
I was trying to parse a java properties file to avoid some Properties loading pitfalls (non ordering, loss of comments).
(Property are of the form 'key = value' where the value can span on multiple ...