1
vote
2answers
15 views

Matching specific Apache VirtualHost with regex

I am currently attempting to match a single Apache VirtualHost entry within an apache config file by the ServerName of the VirtualHost. I am doing this with python, using the re module. Here's an ...
-5
votes
2answers
42 views

Python regex on text file

Hi guys I have question about regex, I need a litle help about something. My code looks like: # -*- coding: utf-8 -*- import re WEEKDAYS = ["nedjelja", "utorak", "četvrtak", "ponedjeljak", "subota", ...
1
vote
1answer
32 views

how to replace only the first word in regular expression in python

i want to ask how we can replace only the first word in regular expression in python i do this code : print "number of all KSU occurrences %i "%len(re.findall("ksu",string,re.IGNORECASE)) print ...
0
votes
1answer
29 views

django urlpattern for repeating group?

I am trying to do some category/subcategory routing in django(1.5). I have 5 level for categories, which could look like. url(r'^(?P<category>\w*)/$', SearchResults.as_view(), ...
0
votes
1answer
40 views

Loop in a REGEX search

I have some .csv files that needs to be parsed and I got stuck in one part that needs to be separated in different rows. to make it clear: One part is that if the value of one key is Y it should ...
0
votes
0answers
20 views

Passing regex to coloumn attribute in happybase scan

I am trying to pass in a list of regexes to the columns attribute in my happybase scan calls. This is because, my coloumn names are made by dynamically appending ids which i dont have acces to at scan ...
2
votes
3answers
54 views

Recursively group sentences based on conjunctions

I have a list of sentences such as: Sentence 1. And Sentence 2. Or Sentence 3. New Sentence 4. New Sentence 5. And Sentence 6. I am trying to group these sentences based on "conjunction criteria" ...
0
votes
4answers
51 views

Regex as if string is a variable

I'm working with a script that would determine if my string would be a valid variable. It's very basic but I can`t seem to figure out how to use regular expression. So basically I want: A-Z a-z 0-9 ...
0
votes
4answers
33 views

Fix regex to extract city names from HTML

I am trying to extract the names: "Harrisburg" & "Gujranwala" from the 2 pieces of code below: <td><a href="/worldclock/city.html?n=97">Harrisburg</a><span id=p217s ...
1
vote
1answer
54 views

Using python regex to create a JSON array of temperature data

I have a log file that stores temperatures in the format: 2013/09/30 11:23:01 Temperature 41.34F 5.19C 2013/09/30 11:23:01 Temperature 99.84F 37.69C 2013/09/30 11:23:01 Temperature 65.86F 18.81C ...
0
votes
1answer
31 views

regex capture html hidden input

im trying to capture joomla token whit python pycurl, im write this function code : import urllib, urllib2, sys, re import cStringIO import pycurl def CaptureToken(cURL): buf = ...
0
votes
1answer
25 views

Using python, to parse cisco configuration files to find interfaces with specific service policy

I have hundreds of cisco configuration files and I need to find (via python) the interfaces with a specific service policy applied in this case WIRELESS-IN. The Regex I am using to capture the ...
1
vote
2answers
72 views

Python - regex returns differently in method than on its own

This takes a directory (sample list of files below) and parses for anything that matches a proper format (below), fixes anything with extra or lacking whitespace (here's the problem), and appends ...
0
votes
1answer
45 views

Regular expression to match phrase with unicode character

I am trying to parse the indicated range in the following sentence with regular expressions in Python (re package) but have had no luck so far: body = 'Adulticides are modelled by increasing the ...
5
votes
1answer
50 views

python re find string that may contain brackets

I am trying to search for a string that may contain brackets or other characters that may not be interpreted as plain strings. def findstring(string, text): match = re.search(string, text) I ...

15 30 50 per page