1,034 Topics

Member Avatar for
Member Avatar for rayidi

Dear Friends, [CODE]<a href="javascript:void(0)" onclick="javascript:chatWith('babydoe')">Chat With Baby Doe</a>[/CODE] Please convert this into regular php expression please. Thanks in advance

Member Avatar for pritaeas
0
131
Member Avatar for mandible

I just want to create a file where I can test code idea's in. Basically I want to save a test.jsp file to my file system then open that up with a browser and have it execute the jsp code contained. Is that possible? Here's a simple test that I'm …

Member Avatar for Sadun89
0
233
Member Avatar for ananth3125

hi, here i tried the coding for splitting the document file from the merged file,, i found the problem that a new document is not creating [CODE] Dim str1 As String = TextBox1.Text Dim str2 As String = str1.Replace("[", "") & str1.Replace("]", "") Dim filename As Object = "f:\" & …

Member Avatar for Reverend Jim
0
159
Member Avatar for m1234ike

Hello Daniweb, I am writing a program to execute the command prompt command "getmac /v >> MACLIST.txt" using a Visual Basic form, including: 2 buttons(getmac and filter the text file) , 2 textboxes (alternate text file name and user name), and two radiobuttons (default text file name or custom name). …

Member Avatar for m1234ike
0
412
Member Avatar for axn

How do i match "00:04" and "4+21:08" which is ("days+hrs:mins" and "hrs:mins") in a file. I would like to combine regex patterns so I can calculate running time. This is what i got for regex but does not match "00:04" --> (\d\d)(\:)(\d\d) [CODE]if($string = ~ m/(\d)(\+)(\d\d)(\:)(\d\d)/) { #code goes here …

Member Avatar for axn
0
161
Member Avatar for davedpss

I am trying to clean up some text that has some white space that I can't seem to get rid of. I have tried replacing \s, \t,\n, \r, \r\n etc. and that strips out most of the new lines but not all. When I look at in a text editor …

Member Avatar for diafol
0
82
Member Avatar for ryan461

I'm trying to get the available disk space on a remote linux host using python. The best way I could think to do this would be to os.popen a df command, and use regex to get the available space from the output. I then need to apply a variable to …

Member Avatar for Gribouillis
0
185
Member Avatar for fiaworkz

I need to output "Exceptional Innovation" <div id="basic-info"> <h1 class="fn org"> <span> Exceptional Innovation </span> Here's my Code [CODE] RichTextBox1.Text = htmlsource Dim myMatch As New System.Text.RegularExpressions.Regex("(?<=<div id=""basic-info""> <h1 class=""fn org""> <span>).+?(?<=</span>)", RegexOptions.IgnoreCase Or RegexOptions.Compiled) Dim matches As MatchCollection = myMatch.Matches(RichTextBox1.Text) For Each itemcode As Match In matches Dim output …

Member Avatar for TechSupportGeek
0
224
Member Avatar for Stefano Mtangoo

Hi, I want to parse PHP entities (classes, variables functions methods and properties) and save information on database (function signature, variable name et al). I'm trying to see alternatives for how I can archieve that with any language (the technique). So far I'm thinking of using regex to match stuffs …

Member Avatar for Stefano Mtangoo
0
194
Member Avatar for triumphost

Trying to re-write a php function to C++ using boost.. I have NOT seen code for this anywhere on the net. I thought it was useful and I need it for C++ but I need help.. definition of the function in c++ [CODE] void preg(string pattern, string subject, string &matches, …

Member Avatar for vijayan121
0
225
Member Avatar for klemme

Hi guys, I would like to validate some form input, and only allow the folowing: letters, numbers, /, - if(!preg_match("*[0-9A-Za-z,-,/]", $url_key)){ $erros[1] = '<small>Error submitting url key!</small>'; } Which is not working.. Its not the point only to allow one / or - But only letters, numbers and /- in …

Member Avatar for pritaeas
0
2K
Member Avatar for deraad

Im really stumped on trying to format user input. I have an input box where users enter data separated by commas. Then I explode it: [CODE] $data = $_POST['data']; $words = explode(',', $data); [/CODE] then I'm analyzing each word. Everything works perfectly when you enter the data correctly. However, if …

Member Avatar for diafol
0
155
Member Avatar for asif49

The best way to describe my problem is with an example... Consider, [CODE] $content = "This is a string <kjfkldsjf> <jslkdjfksd>"; [/CODE] What I want to do is clear everything in between the <...> tags no matter how long the length of text in between the left and right arrows …

Member Avatar for asif49
0
119
Member Avatar for triumphost

Hey all. I'll make this quick. I want to search for a pattern and replace it with an empty string using the boost/curl libraries OR strictly c++.. No DotNet. The below code I have, removes HTML Tags from a file/string: [CODE] static string StripTags(string source) { int iSize = (int)source.length(); …

Member Avatar for vijayan121
0
309
Member Avatar for Mirfath

hi! i have a form to enter data i want to put validations in the text boxes and prompt the user if he/she enters the wrong data i want to put validations for phone number Date of birth email i tried using regex but it says that i am missing …

Member Avatar for Mirfath
0
138
Member Avatar for adarshcu

Hi All, I need to have a Regex that will not allow just spaces, but it can allow sentences with spaces. It should allow any special characters that occur as well. Actually, it is for a text area of comments. So i want to restrict him from entering just spaces. …

Member Avatar for adarshcu
0
112
Member Avatar for IanArcher

Hi, i am new to PHP but i have some common knowledge to recognizing commands and such. in my page i have code like this [CODE]<div class="page_column page_column_first" id="page_column_1" style="width: 499px;"><div class="page_block_container" id="page_block_759"><div class="disignBoxFirst"> <div class="boxFirstHeader"><div class="dbTitle">Up and Coming</div></div> <div class="boxContent"><div class="dbContentHtml"><p>This is a placeholder for up and coming news …

Member Avatar for pritaeas
0
175
Member Avatar for renzlo

I know this is quite simple for you to code but for me as a beginner I need some examples or guides. I have a text file which has this content: [CODE]random line random line random line random line random line random line random line random27061-1-0256487952random words random words random …

Member Avatar for renzlo
0
196
Member Avatar for RicardoE

Hello dear community, I have a problem which I have no idea how to walk around, see I have a really large database, with france zip codes, I imported this data from excel. the thing is that when it imported all the zip codes starting by 0 are not starting …

Member Avatar for smantscheff
0
144
Member Avatar for Dancer90

I am doing a project in class for computer science. I have to make a hangman game that consists of the following: Get the words from a file and pull in the next word after each game, display the word as dashes for the user to guess, prompt the user …

Member Avatar for joehms22
0
377
Member Avatar for madtowneast

Hi all, I have been trying to parse the a log file to plot some of the data in it. The format is something like this: [CODE]PyrateBufferManager: 2011-10-24 15:42:47.709684: CurrentAquiredBuffers: 0 ReturnBufferCount: 11527 CurrentAquiredBytes: 0 SimDataCollectorMonitor-00A: 2011-10-24 15:42:47.709684: SNProfile: {'SNLoop': 6133}[/CODE] I was trying to use regex, but didnt get …

Member Avatar for madtowneast
0
156
Member Avatar for utroda

Hello, I'm trying to replace {include %filename.php%} with that file from the server. I can get this to work file if the file is plan html text using the function below. [CODE] $str = "This would be a paragraph of text. {include %news.php%}"; preg_replace_callback("/\{include %(.*?)\%}/", function($m) { return file_get_contents(CORE . …

Member Avatar for utroda
0
360
Member Avatar for djmonster

Hello All, Can everyone help me to solve this problem ? Im doing an assignment about downloading a file and write it to a new file. My problem is the file that I was trying to download is very large, so everytime I compile my Download class and the main …

Member Avatar for Anyday
0
198
Member Avatar for utroda

Hello, I'm looking for some help on the following line of code, it keeps throwing an error. [I]Parse error: syntax error, unexpected T_FUNCTION Line 168.[/I] The code below is line 168. [CODE]$content = preg_replace_callback("/\{include '(.*?)'}/", function($m) { return file_get_contents(CORE . 'includes/' .$m[1]);}, $str);[/CODE] Any ideas?

Member Avatar for pritaeas
0
211
Member Avatar for andimiami

Hi! I am trying to write a method w/i a larger program, and it's purpose is to read in a section of the string between " " and then within that section split each subsection apart if it contains spaces and matches a particular RegEx and if a space is …

Member Avatar for hfx642
0
110
Member Avatar for felix001

What is the best way to invoke the os.system command and assign it to a variable without printing the output ? Example : [CODE]ifName = os.system('snmpwalk -v 1 -c <community> %s ifName.%s' % (switch,port))[/CODE] Also with the output of the snmpwalk I will be wanting to only assign the last …

Member Avatar for felix001
0
391
Member Avatar for andimiami

I am writing a Java program, and I need to be able to call these two methods, but I'm kind of confused. These methods need to be able to match the following data: This would be a sample input if what I am checking... LASTNAME "Rosemont" # LASTNAME "Rose Mont" …

Member Avatar for andimiami
0
116
Member Avatar for RMWChaos

Maybe this is a bit too broad a question and too much code for this forum, but I'll give it a shot... OS: Win7x64 6.1.7601 py: 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] wx: 2.8-msw-unicode My question is more of a general nature than in regards …

0
205
Member Avatar for Dani

Hi, How can I use preg_replace to determine if a string contains a word beginning with a pattern, and if it does, remove it? Basically I want to capture query strings from a search, but throw away search modifiers. For example, the search query string: site:daniweb.com query would just become …

Member Avatar for diafol
0
2K
Member Avatar for deepak.marur

I have a data store having a Note field (a textarea) and want to display all Notes satisfying a user input (even metacharacters). I've written the following function to handle this: function notefilter() { var newfilter = Ext.getCmp('searchnote'); var searchStr = newfilter.getValue(); searchStr = searchStr.replace('?', '\\?').replace('*', '\\*').replace('+', '\\+').replace('{', '\\{').replace('}', '\\}').replace('[', …

Member Avatar for deepak.marur
0
401
Member Avatar for mx tommy

Hi! I'm trying to learn some C in order to make some changes to some existing programs that are written in C. For what it's worth all my experience to date has been with PHP, so this is quite different for me. Basically, I want to have an array, (patterns …

Member Avatar for mx tommy
0
227
Member Avatar for woopi

How do I deal with quotes here? What i want is /[^a-zA-Z0-9-_.,!()'\/"]/ but how do i deal the quotes? [CODE] $pattern = '/[^a-zA-Z0-9-_.,!()'"\/' . $whatever . ']/'; return preg_replace($pattern, '', $value); [/CODE] Cheers!

Member Avatar for woopi
0
1K
Member Avatar for bipies

Hi! I'm simply need to convert a string like: /blablabla/123123 to 123123 it should be easy I'm sure, but I can't get it :(

Member Avatar for diafol
0
107
Member Avatar for Buppy

Hi, A quick question - i have a string containing text like this: [CODE] \\u003cspan class=\\\"someClass\\\">Some text\\u003c\\\/span> [/CODE] How do i get that "Some text" value into an array? I tried [CODE] preg_match_all("/\\\\u003cspan class=\\\\\\\"someClass\\\\\\\">(.*?)\\\\u003c\\\\\\/span>/",$str,$res); [/CODE] Returns nothing. I think there's something wrong with the regex pattern. Maybe anyone can correct …

Member Avatar for pritaeas
0
146
Member Avatar for CoolAtt

hi . can someone plz explain how to do regex in C. input: a text file. aim: read each line from the text & check if a RegEx pattern exists. finally return that pattern if it exists. plz share any algo or code snippets if u have.thx.

Member Avatar for rubberman
0
236
Member Avatar for Deepali_Jain

I am compiling a VC++ source file in VS2008 licenced edition. Using the following header files: #include <regex> But I am getting the below error while compiling. fatal error C1083: Cannot open include file: 'regex': No such file or directory Please advise what Iam missing here.. :(

Member Avatar for Ancient Dragon
0
975
Member Avatar for Narayanan87

HI I am new to regex, could anyone help me in finding the java code using regex: My input string is : MyData 68309486 Bob I want to fetch only the digits in sequence like 68309486. PLz help me!!!

Member Avatar for thekashyap
0
160
Member Avatar for Creatinas

Hello, here is a thing, i'm beginner at wxPython ant Pyhton too. I have written small program here is a example: [CODE]import wx import urllib2 import re class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, size=(600,400)) self.panel=wx.Panel(self) self.areaa = wx.TextCtrl(self.panel, pos=(0,10), size=(400, 20)) self.area = wx.TextCtrl(self.panel, style = …

Member Avatar for snippsat
0
1K
Member Avatar for DILO3D

i have a following paragraph. [CODE] ++ a xxx xxxx ++ b yyy yyyy yyyyy ++ c zz zzz [/CODE] i need to delete this line. ++ b yyy yyyy yyyyy What is the regular expression i want to use?

Member Avatar for pritaeas
0
127
Member Avatar for debasishgang7

Hi all, I am trying to extract some text from a HTML page using regex. [CODE]<html> ...some code.... <B><FONT color="green">TEXT to BE EXTRACTED 1</FONT></B><br> <P> <B><FONT color="green">TEXT to BE EXTRACTED 2</FONT></B><br> <P> <B><FONT color="red">TEXT to BE EXTRACTED 3</FONT></B> ....some code.... </html> [/CODE] I want to make a script which will …

Member Avatar for debasishgang7
0
129
Member Avatar for Danielle87

What this program is does is search the text and where the word appear it displays the line. However. I am recieveing a [U]SyntaxError: EOF while scanning triple-quated string literals[/U]. When i try to run in on python 2.6. I dont have a an option of changeing versions. Just need …

Member Avatar for Danielle87
0
2K
Member Avatar for ray-solomon

This program I wrote is supposed to restart tor, wait 5 seconds, then look for a PID number using regex. It compiles and runs fine but the regex logic never displays "good". I'm confused. [CODE]#include <sys/types.h> #include <regex.h> #include <stdio.h> #include <string.h> // gcc -o tor_restart tor_restart.c // chown root …

Member Avatar for ray-solomon
0
170
Member Avatar for ghost_from_sa

Hi guys, I seem to have come across a weird issue in internet explorer. I've been working on doing regular expressions for a register form, and I've checked it in Firefox, and Chrome and it seems to work for both of them but yet it doesn't work for Internext Explorer …

Member Avatar for vibhaJ
0
253
Member Avatar for JoshuaBurleson

I'm having a terrible time with regular expressions, possibly because I'm using a python2 reference, but maybe not. For example how would I find \s\w within a string and then change that character?

Member Avatar for JoshuaBurleson
0
308
Member Avatar for ntagrafix

hi, I worked around to modifying regular expression below but i could't get what I need. I google it, many things found but not for what i want. [CODE] Dim valid AS Boolean = Regex.IsMatch(TextBox1.Text, "^(,?\d+){0,20}$") [/CODE] Allow numbers exactly like 32,1,6,32,12,21,21,54,675,8,4,3,2,9,0,21,21,21,43,744 in TextBox1. Perfect. NOW i want 20 numbers …

Member Avatar for ntagrafix
0
217
Member Avatar for coroll

Hi all, I want to know how to assin a return value to a variable when calling a regex function. it always returns a bit type of value(its ok). i want that bit type of value tobe cheked whether it is '0' or '1' this is my C# code in …

Member Avatar for coroll
0
181
Member Avatar for klemme

Hey, I have all pages in my site, coming from the DB, and I get urls like this: [B]enkeltwebdesign/index.php?sid=1&titel=FORSIDE[/B] The name of my site: [I]enkelt-webdesign.dk[/I] Does someone know how to write the correct mod_rewrite, so I can change the urls to: enkelt-webdesign.dk/forside (forside = home) enkelt-webdesign.dk/webdesign (...) [I]etc etc[/I] So …

Member Avatar for klemme
0
250
Member Avatar for titosd

Hello, I want to write a program. in the program i need to generate a password that contain 8 - 10 charachters. i did it, but without regex, Can any one help me, how to do this with the regular exp ? the criterias for the pass are: 1- the …

Member Avatar for pritaeas
0
89
Member Avatar for 100110010110100

I have tried parsing a website with curl and then searching it with regular expressions, but I have not been able to perform a regex search. Even if I try parsing news.google.com and then search for any non digit, the code returns that there is no match. If I run …

Member Avatar for 100110010110100
0
910
Member Avatar for reygcalantaol

Hello guyz, I'm glad I finally back here. I need help using the preg_match function. I am scraping url and I need to get the specific value from the html tags. Here is the string [I]<p><b>1,664</b> Referring IP addresses</p>[/I], I need to get [I][B]1,664[/B][/I] How can I achieve it using …

Member Avatar for reygcalantaol
0
128

The End.