Hi,
i want to parse VB6 code via Regex. However being new to Regex I have encountered a few problems concerning the regexes to use. Currently, I have problems recognizing these constructs:
' Subs
' Sub Test
Private Sub Test(ByVal x as Integer)
'Private Sub Test(ByVal y as Integer)
Dim dummy as String
dummy = "Private Sub Te...
We're in the final stages of shipping our console game. On the Wii we're having the most problems with memory of course, so we're busy hunting down sloppy coding, packing bits, and so on.
I've done a dump of memory and used strings.exe (from sysinternals) to analyze it, but it's coming up with a lot of gunk like this:
''''$$$$ %%%%
...
Although this question is similar to this thread
I think I might be doing something wrong at the time of constructing the code with the Regular Expression.
I want to match anything in a line up to a comment ("#") or the end of the line (if it doesn't have a comment).
The regex I am using is: (.*)(#|$)
(.*) = Everything
(#|$) = commen...
Hi, I have very little experience using regular expressions and I need to parse an angle value expressed as bearings, using regular expressions, example:
"N45°20'15.3"E"
Which represents:
45 degrees, 20 minutes with 15.3 seconds, located at the NE quadrant.
The restrictions are:
The first character can be "N" or "S"
The last charac...
Hello!
I am looking for a single perl compatible regex that would parse strings of the form:
param1=value1&...¶m2=value2&...
and extract values for param1 and param2 only. But
param2 may precede param1
There may be no param1 or param2
param1 or param2 (or both) may have empty values, i.e. param1=&...
...
I'm wondering if its possible to use string substitution along with the python re module?
For example I'm using optparse and have a variable named options.hostname which will change each time the user executes the script.
I have the following regex matching 3 strings in each line of the log file.
match = re.search (r'^\[(\d+)\] (SER...
I am trying to do search-and-replace using a regex in Perl.
The text I am searching for is:
<space>Number<space>NumberNumberNumber
and I want to replace it with:
<space>Number<space>NumberNumberNumberI
I have the following regex which works in finding the string:
\s[0-9]\s[0-9[0-9][0-9]
But what do I do about replacing the s...
I'm not new to Python but a complete newbie with regular expressions (on my to do list)
I am trying to use python re to convert a string such as
[Hollywood Holt](http://www.hollywoodholt.com)
to
<a href="http://www.hollywoodholt.com">Hollywood Holt</a>
and a string like
*Hello world*
to
<strong>Hello world</strong>
...
I am after a Regex expression that will strip out white spaces when there is two or more repeated, leaving just one space behind.
For example this line
The cow jumped over the moon
which has multiple spaces separating the words in some cases would become
The cow jumped over the moon
...
I am trying to load an XML file from a different domain name as a string. All I want is an array of the text within the < title >< /title > tags of the xml file, so I am thinking since I am using php4 the easiest way would be to do a regex on it to get them. Can someone explain how to load the XML as a string? Thanks!
...
I am attempting to write a CF component that will parse wikiCreole text. I am having trouble getting the correct matches with some of my regular expression though. I feel like if I can just get my head around the first one the rest will just click. Here is an example:
The following is sample input:
You can make things **bold** or //...
I have the following data in my "Street_Address_1" column:
123 Main Street
Using Postgresql, how would I write a query to update the "Street_Name" column in my Address table? In other words, "Street_Name" is blank and I'd like to populate it with the street name value contained in the "Street_Address_1" column.
From what I can ...
I've used both of the following Regular Expressions for testing for a valid email expression with ASP.NET validation controls. I was wondering which is the better expression from a performance standpoint, or if someone has better one.
- \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
- ^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\...
I have a really long string. I would like to add a linefeed every 80 characters. Is there a regular expression replacement pattern I can use to insert "\r\n" every 80 characters? I am using C# if that matters.
I would like to avoid using a loop.
I don't need to worry about being in the middle of a word. I just want to insert a linefeed...
In PHP, you have preg_replace($patterns, $replacements, $string), where you can make all your substitutions at once by passing in an array of patterns and replacements.
What is the equivalent in Python?
I noticed that the string and re functions replace() and sub() don't take dictionaries...
Edited to clarify based on a comment by ric...
Hello,
I am using PCRE for some regex parsing and I need to search a string for words in a specific pattern (let's say all words in a string of words separated by commas) and put them into a string vector.
How would I go about doing that?
...
Spent me 3 hours to get a good regex finished for parsing these 3 main possible situations.
Redden, Taylor Captain Hasting Jr.
Redden, Taylor Hasting Jr.
Redden, Taylor Hasting
full, l, f, m1, m2, s = /your_regex_here/.match("Redden, Taylor Captain Hasting Jr.").to_a
I want to see what other possible answers there are beside min...
For a project of mine, I'm trying to implement a small part of the BitTorrent protocol, which can be found here. Specifically, I want to use the "Bencoding" part of it, which is a way to safely encode data for transfer over a socket. The format is as follows:
8:a string => "a string"
i1234e => 1234
l1:a1:be => ['a', 'b']
d1:a1:b3:one3:t...
Hi guys, I want to know what's the meaning of tilde operator in regular expressions.
I have this statement:
if (!preg_match('~^\d{10}$~', $_POST['isbn'])) {
$warnings[] = 'ISBN should be 10 digits';
}
I found this document explaining what tilde means: ~
It said that =~ is a perl operator that means run this variable against this...
Hello,
How can I set which order to match things in a PCRE regular expression?
I have a dynamic regular expression that a user can supply that is used to extract two values from a string and stores them in two strings. However, there are cases where the two values can be in the string in reverse order, so the first (\w+) or whatever ne...