1,034 Topics

Member Avatar for
Member Avatar for kaiwahl

I have a problem in a payment solution I have made. In this, I use ereg to extract a returned Transaction ID from the payment provider, and with PHP 5.3 this does not work anymore. The code used was: ereg('<TransactionId>(.+)</TransactionId>',$resultat_3,$c); I have tried to use this instead: (but it doesn't …

Member Avatar for diafol
0
167
Member Avatar for chrishea

I'm not very familiar with Javascript or Regex but I built a script that is working well with one small flaw in the Regex part. What I want to do is to find commas following alpa-numeric characters (actually almost anything other than a double quote) and then replace the comma …

Member Avatar for pritaeas
0
282
Member Avatar for hrul

hye guys..here is the problem..how to use the item in the listview in order to retrieve data from database? i have code that display 4 digit in every line in listview item.. Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click Dim xmtBuf() As Byte = {&HAA, …

Member Avatar for jezguitarist30
0
122
Member Avatar for magicmarkuk

Hi I am having trouble understanding how the pre_replace function works. I am using a script which has the following line: $ret = preg_replace("#(@|telefone|e-mail|.com|skype|.com.br|fone|www.|hotmail|yahoo|ig|aol|uol|gmail|bol|msn|MSN)#i", "\\1scriptolutionreplacement", $ret); What is happening is that any word with for example the letters ig or uol in it is getting caught. Is there a way …

Member Avatar for magicmarkuk
0
151
Member Avatar for keval007

Hi, I have text file which has lots of text as well as HTML data. There are some line as shown below. 06/30/12 00:40:30.73 Sending Email - Group: 4FD7917824F1B-EMAIL, 0, Message: There are lots of lines like above in text file. I want to extract following data from the entire …

Member Avatar for diafol
0
102
Member Avatar for diafol

Hi all. Am having a senior moment here. I have a htaccess file thus: Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]*)/*([^/]*)/*([^/]*)/*([^/]*)/*([^/]*)/*$ index.php?lang=$1&top=$2&middle=$3&bottom=$4&sub=$5 [L] Which basically allows me to show http://www.mysite.com/cy/tgau/cemeg-1/ for http://www.mysite.com?lang=cy&top=tgau&middle=cemeg-1 That's all well and good. However, I'm getting real problems directing my forms to /includes/login.php This …

Member Avatar for cereal
0
234
Member Avatar for xzero1

hi, i am using regular expression in extract paragraph from html code but it gives me only one (the first one) line written in first <p> i want the whole article in my string. here is my code. Match m = Regex.Match(htmlstring, @"<p>\s*(.+?)\s*</p>"); htmlstring=m.Groups[1].Value; where "htmlstring" all the html code …

Member Avatar for nmaillet
0
3K
Member Avatar for cjohnweb

So I am trying to do a neat little script in a wordpress plugin that replaces matching keywords with links to other articles on the site. I think I'm done all except one little thing down here below. I need to fix the preg replace function. It should match anything …

Member Avatar for cjohnweb
0
407
Member Avatar for indiang

I try to understand the regex in python. How can i split the following sentence with regular expression? "familyname, Givenname A.15.10" this is like the phonebook in python regex http://docs.python.org/library/re.html. The person maybe have 2 or more familynames and 2 or more givennames. After the familynames exist ', ' and …

Member Avatar for TrustyTony
0
243
Member Avatar for gowans07

Hi, i'm trying to get the following data from within the html tages <td class="colRight">CWCH60</td> where CWCH60 is the data which changes and needs to be extracted. I have tried the following Regex patterns [^td|<|>|/|class|\s|^="colRight"][A-Z|a-z|0-9]*[^</td>] [^<td][^\s][^class][^="colRight">][A-Z|a-z|0-9]*[^</td>] [^td\sclass=""colRight">][A-Z][a-z][0-9] all work fine in an online regex builder/tester but return WCH60 when executed. …

Member Avatar for gowans07
0
137
Member Avatar for missil9

Hey all, I usuallly don't like asking for help on these sites but I have been kicking myself for a while now implementing boost regex for a program (i have never had any prior issues). I believe the issue is with my regex syntax but i have tried numerous variations …

Member Avatar for missil9
0
318
Member Avatar for patocardo

I cannot find the mistake in the following code function doArray(n){ // test with n > 1000 var str, i, j,arr=[], cnt=0, q=0, re; str = ["one two three","two three four","three four five", "four five one", "five one two"]; for(i=0; i<n; i++){ j = Math.round(Math.random()*(str.length-1)); arr.push(str[j]); } re =/two/g; for(i=0; …

Member Avatar for Airshow
1
131
Member Avatar for teedoff

I have two inputs for users to enter, what should always be a nueric string. This string gets processed and some mathmatical cals done to them, then the results are returned to the same page via cf div and bind attribute. Everything works if only numbers are entered. I have …

Member Avatar for arrgh
0
490
Member Avatar for dwlamb

A script I am writing on works on the DVD present in the drive at time of script execution. I want to extract merely the label of whatever appears after '/media/'; ./script.sh /media/DVDRW-43/ An obvious solution would be to get the substring by `path='echo ${file:7:9}' #renders DVDRW-43` but I would …

Member Avatar for cheochi
0
182
Member Avatar for iamthesgt

I am using Awk inside a bash shell script to search header files for c++ functions so I can add these functions to another file. All of the functions I need will have form: type getName() or type setName(type value) Right now I get all the functions listed in between …

Member Avatar for iamthesgt
0
454
Member Avatar for coder389

I have the following code: int numberOfWords = 50; string regexMatch = string.Format(@"^(\w+\b.*?){{" + numberOfWords + "}}"); string firstWords = Regex.Match(result, regexMatch).Value; This code displays the first 50 words in a string. Now I want to display next 50 words (51st word to 100th word). How do I do it?

Member Avatar for Momerath
0
144
Member Avatar for lilym

I am new to Regex... I need to split by "|&|" -- three characters in that exact order. For example, **"abc|&|e&f**" should return *"abc"* and *"e&f"*. I tried string.split("|&|") , but it return all single characters.

Member Avatar for NormR1
0
56
Member Avatar for achava

Suppose I need to have a regex expression (using Perl regex) that, say, matches a*b\q as simple text and does not interpret a* as any number of a's. I know it is simple here, but I need it to work for ANY string of characters.

Member Avatar for 2teez
0
303
Member Avatar for bkjfdghiuds

hello I am following this tutorial on how to scrap website information http://www.newthinktank.com/2010/11/pyt ... -scraping/ this is my code: EDIT: do not post off site, moved here #! /usr/bin/python from urllib import urlopen from BeautifulSoup import BeautifulSoup import re def cleanHtml(i): i = str(i) # Convert the Beautiful Soup Tag …

Member Avatar for snippsat
0
2K
Member Avatar for andarivaadu1

Hi, I don't have any idea about regular expression. Can some on please suggest a good website for regular expression Tutorial. Also 1.Can some one please help me to generate a regular expression meeting all these requirements * A strings minmum length must be 3 charcters, and maximum length must …

Member Avatar for seslie
0
156
Member Avatar for dartiss

Morning, I'm attempting to perform a preg_match against a regular expression to identify whether it's a YouTube video or not. I've got, I'll admit, the regular expression from elsewhere... \s*(https?:\/\/www.youtube(?:-nocookie)?.com\/(?:v|embed)\/([a-zA-Z0-9-]+)).* This appears to work fine. However, I'm getting the following error when I attempt the preg_match... WARNING: [filename].php:[line] - preg_match() …

Member Avatar for dartiss
0
200
Member Avatar for poojavb

Hello Friends... I need help on regular expressions.... I tried the following way but it did not work for me....please help me to create a regular expression... ^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(^[a-zA-Z0-9@\$=!:.#%]+$) My requirement is -> Min 8 to 15 characters - this I will do with the length validation or by including in …

Member Avatar for poojavb
0
250
Member Avatar for grr

Here's my current code: /[\w\s]+/ I'm trying to make the following characters match: [CODE] Q W E R T Y U I O P A S D F G H J K L Z X C V B N M q w e r t y u i o p …

Member Avatar for YoussefUSF
0
200
Member Avatar for bboris

Filterable `AbstractListModel` uses `originalModel` of `JList` as source and excludes those items from `originalModel` that matches exclude criteria specified by given regex. It also allows reusing same model (with filtering capability of course) for multiple JList components. It also registers as `ListDataListener` to `originalModel` model to be able to relay …

0
64
Member Avatar for tendaishava

hello guys my code is not giving me any errors but wont execute the task it just loops can, anyone help me debug it. its a code for extracting book information from a chinese website. thanks in advance. using System; using System.Collections.Generic; using System.Collections.Concurrent; using System.Text; using System.Text.RegularExpressions; using System.IO; …

Member Avatar for skatamatic
0
337
Member Avatar for CarterLangley

Hi all, Here is all my code for processing a form. Having trouble with the last else statement. The error is saying it is not expecting that last else!! Sorry for all the code, but I thought I would put it all in here. Could somebody please let me know …

Member Avatar for CarterLangley
0
205
Member Avatar for notconfirmed

Hello there, I'm a newbie in regex in c#, and I have a problem in parsing the html tag using regex in the <span> tag. here the html file that i want to get the value. <li><span>Date of birth</span>December 16, 2000 (Age: 12)</li> i want to get the December 16, …

Member Avatar for Mitja Bonca
0
3K
Member Avatar for apanimesh061

What should be the regular expression for thid code ??? `<span style="text-align:justify;">Stepping out of the Shadows:M6 Once touched... Marisa Somerville has changed. Now a confi dent, groomed, successful businesswoman, in some ways she's nothing like the scared wife of an abusive husband that Rafe Peveril survived a plane crash with …

Member Avatar for apanimesh061
0
297
Member Avatar for Dani

This has been frustrating me for about 20 minutes already and I don't want to spend much more time on it, so any help would be much appreciated. The editor that we use which syntax highlights Markdown text has has bug in which it highlights text as code when it …

Member Avatar for Dani
0
770
Member Avatar for mbhanley

Need help with code i am trying to acheive upload of videos but when they are uploaded the file names need to be changed to have hyphens in replace of white space and still keep the exstensions. its proving difficult because once uploaded ffmpeg needs to read the output as …

Member Avatar for mbhanley
0
466
Member Avatar for bishisht

Hello there below is the easy way to get the email addresses extracted from any file. import os import re import sys def grab_email(file): """Try and grab all emails addresses found within a given file.""" email_pattern = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b',re.IGNORECASE) found = set() if os.path.isfile(file): for line in open(file, 'r'): found.update(email_pattern.findall(line)) for …

Member Avatar for TrustyTony
1
306
Member Avatar for jony90

Hi Is there anyone who could help to figure out how link regexbuddy to Delphi 7SE?

Member Avatar for pritaeas
0
92
Member Avatar for nicewave

Could someone tell me why I can't use the following code? It kept saying 'string' does not contain a definition for 'Match' and no extension method 'Match'. string SearchText = "7,true,NA,false:67,false,NA,false:5,false,NA,false:5,false,NA,false"; string Regex = @"\btrue\b"; int NumberOfTrues = Regex.Match(SearchText, Regex).Count;

Member Avatar for Mitja Bonca
0
194
Member Avatar for emclondon

Hello everyone, I'm trying to write a script which accepts URL by GET and then validates the URL before processing it. for the sake of arguement lets say that the URL I'm expecting is in this format http://mysite.com/myscript.php?url=http://blahblah.blahblah.bla/blahblah/blahblah/blahblah.bla http://subdomain.domain.tld/section/category/file.ext I need to validate the part which is a link to …

Member Avatar for pritaeas
0
124
Member Avatar for honeybee2090

hi guys few days ago i was trying to find some thing to learn and i found a code it leech proxies from web but method used is post method/ http webrequst .... problem is here want to do same thing with web browser here r the codes [ICODE]Dim request2 …

Member Avatar for honeybee2090
0
117
Member Avatar for Asotop

Hello ! I'm currently working on a school project where at one place in the project I'm suppost to make a program, which converts a binary ip adress to decimal. The input format is either: 11111111 11110000 00000000 01111111 or 11111111111100000000000001111111 My main program, works as follow: string iPAddress = …

Member Avatar for Mitja Bonca
0
146
Member Avatar for Donnovan

hello ya'll, i'm looking for help with using regex for finding a name like (v/d haren). can someone help with solving this

Member Avatar for thines01
0
129
Member Avatar for Usmaan

I am using: underscoredWord = Regex.Replace(word, "[^" + correctLetters + "]", " _"); for my Hangman game. It basically chops the word up and replaces all the text with an underscore. This works fine if the guessing word is only "one word". So the word: "Building" will get converted to: …

Member Avatar for thines01
0
586
Member Avatar for Donnovan

Hallo, How can i use Regex to match names in different files. e.g. i have 3 files with names. i need to link the matching names in the different file. any ideas.

Member Avatar for thines01
0
108
Member Avatar for srinidelite

<script type="text/javascript"> function validate(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode(key); var regex = /[0-9]|\./; if (!regex.test(key)) { theEvent.returnValue = false; alert("Only Numeric is Allowed"); if (theEvent.preventDefault) theEvent.preventDefault(); } } </script> > Hello, > > I'm using the above script for …

0
68
Member Avatar for Clarkeez

Hello I'm not sure how this is possible but I want to enter a wildcard(?) into a php variable.. like this, <?php if($_SERVER['HTTP_HOST'] == '*.domain.com') { //do something } ?> Notice the * I basically need it to match if its any subdomain of domain.com Possible?

Member Avatar for Biiim
0
370
Member Avatar for freddyk

Hi everyone. I'm trying to convert an assembly code to its corresponding regular expression. I'm trying to match program patterns to discover anomalies. Being a novice in assembly language, i thought i would try to first convert a simple addition program to its corresponding expression before moving onto other code. …

Member Avatar for freddyk
0
693
Member Avatar for dalip_007

well Guys i am not sure if what i want is atleast possible or not. what i want is to write a script in php, which will crawl through all my hard drive for all files and folders irrespctive of the file type and pick the emails address up and …

Member Avatar for pritaeas
0
201
Member Avatar for Dani

Soooo ... quick question :) I need to do some HTML parsing with regex :) I currently use `$output = preg_replace('/>\s+</', "> <", $output)` to strip whitespace between any two HTML tags. What can I do to strip whitespace only between paragraph tags. For example, only between `</p>` and `<p>` …

Member Avatar for Dani
0
418
Member Avatar for shah1509

I have an application that can filter a datagridview based on date using a datetimepicker. The "date" column in my database is a datetime data type, hence it will contain a date and time stored within but there is some data which have only dates. My problem is my datetimepicker …

Member Avatar for Mitja Bonca
0
619
Member Avatar for saad749

I have this Regular Expression in C#: Regex myRegex = new Regex(@"^[a-zA-Z]{1}\s(! | && | \|\| | -> | <->){1}\s[a-zA-Z]{1}$"); if (myRegex.IsMatch(expression)) { validated = true; } else { validated = false; } and I would like to match the following types of Strings: A && B A -> B …

Member Avatar for saad749
0
198
Member Avatar for apals

Hello friends, I am working an a section of application which needs to Parse CSV Logs generated by PostgreSql server. - The Logs are stored C:\Program Files\PostgreSQL\9.0\data\pg_log - The Server version in 9.0.4 - The application is developed in C Sharp * The basic utility after Parse the Log is …

Member Avatar for apals
0
613
Member Avatar for SCass2010

Hi everyone, Just wondering if anyone could help. At the minute I need to check a command line for the parameter "--date=something", I've been using the re module with python like this cmd = "python myapp.py --name=stephen --date=20120323 --test=testthis" found = re.split (r"--date.*", cmd) print found but this prints the …

Member Avatar for TrustyTony
0
184
Member Avatar for tendaishava

I would like to find out what this code snippet does. i know it involves extraction from a webpage format gb2312 but can ano\yone explain line by line, i appreciate the help... :) Code blocks are created by indenting at least 4 spaces ... and can span multiple lines if …

Member Avatar for thines01
0
234
Member Avatar for srinidelite

var RE_SSN = /^[0-9]{3}[\- ]?[0-9]{2}[\- ]?[0-9]{4}$/; hello , i would like to know what is the meaning behind in these ^ ,[\- ],$ symbols??? and i would able to follow that the script logically verifying the format of text being entered!! i.e NNN-NN-NNNN... Thanks in Advance .. Srini.

Member Avatar for srinidelite
0
108

The End.