1,034 Topics

Member Avatar for
Member Avatar for aquaticdeity

Hi all, I don't know whether my question belong here but any ways why every browser has a built-in regex engine? Why they have to find patterns in a http page?

Member Avatar for cwarn23
0
45
Member Avatar for wildgunman

I'm writing a program which searches through a list of medium sized text files for a particular keyword string. This string may appear more than once in the file. The files are generally parsed out for readability, so they have hard returns at the 80 column mark within paragraphs. As …

Member Avatar for d5e5
0
122
Member Avatar for mrcniceguy

i`m having this problem after whenever include or require is Used. help please i dont know how to solve this. Fatal error: Cannot redeclare validateemail() (previously declared in C:\wamp\www\kislat\functions\functions.php:3) in C:\wamp\www\kislat\functions\functions.php on line 26 [code=php] <?php session_start(); require "config.php"; $user=$_SESSION['user']; $id=$_SESSION['id']; if(!session_is_registered('user')){ header("Location: checklogin.php"); exit; } define('INCLUDE_CHECK',1); require"functions/functions.php"; require"includes/functions.php"; //$user=$_POST['user']; …

Member Avatar for mrcniceguy
0
831
Member Avatar for PierlucSS

Thank you for reading, I am currently trying to pass through a project or whole sites containing many pages to determine wether they are xhtml-strict or not with a local xhtml-strict.dtd file. I cannot go through a webservice it would be too overkilling for server and host might even probably …

Member Avatar for PierlucSS
0
238
Member Avatar for harry010

Hi, I'm currently working on a script that parses out function keys in a string of text. I've got this code which works, but was just looking for ideas on how to improve it :) I would have liked to use regex, but I would need to do variable substitution …

Member Avatar for harry010
0
86
Member Avatar for sawant_nitesh

content eg. 1. java.lang.String, 2. java.util.HashMap<Integer, Integer>, 3. java.util.ArrayList<Integer>, 4. java.util.HashMap<Integer, ArrayList<String>>, 5. java.util.HashMap<Integer, ArrayList<ArrayList<String>>>, I need a regex for matching method parameters in Java. I have tried with this one.. ([a-zA-Z\. ]+,)|([a-zA-Z\. ]+<[a-zA-Z\., ]+(<[a-zA-Z\., ]+>)*>[ ]*,) It is matching first 4 strings. But it is not matching 5th one, …

Member Avatar for Freaky_Chris
0
86
Member Avatar for johndoe444
Member Avatar for Pankaj18

Hi, I am using following code to Highlighting keywords in a text or resume. My code: // al is an Arraylist which have keywrods as .net, java, xml... [code] al = (ArrayList)Session["keyWords"]; for (int i = 0; i < al.Count; i++) { if (s.Contains(al[i].ToString().ToLower()) || s.Contains(al[i].ToString().ToUpper()) || s.Contains(al[i].ToString())) { //s …

Member Avatar for Pankaj18
0
111
Member Avatar for Frankey

Hi there, I am building a blog at the moment i have a amazing script that search a post for the images in it. So i can just setup a post template, call the images that are in the post and go. In this way i put the images unedited …

Member Avatar for Frankey
0
203
Member Avatar for wildgunman

I'm currently learning how to read through large groups of text files to scan for key words for some research work I'm doing. I came across an example that I don't fully understand, mostly because my Perl knowledge is a little piecemeal and it's been tough trying to find a …

Member Avatar for d5e5
0
149
Member Avatar for Dimansu

Hi, I have a textbox named fullnameTextbox. I want the user to only type letters in that textbox.I have a code for it but when there is a spacebar between 2 correctly typed words my error message pops up.How can i fix this? [CODE] Match matchMyRegex = Regex.Match(fullNameTextBox.Text, "^[a-zA-z]*$"); if …

Member Avatar for Geekitygeek
0
109
Member Avatar for gladiator1919

hello every one i'm trying to send emails via my application i used smtp, but it throw exception someone told me to login using pop3 first, but it throws the exception "'220 servername ESMTP" here is my code [code] static void DoPopAuth(string host, string user, string passphrase) { TcpClient cli …

Member Avatar for gladiator1919
0
142
Member Avatar for Zafrusteria

I have a need to strip "some" of the comments from a C file. The comments can be C or C++ style and can ofcourse be part, single or multi line comments. As in [code=c]/* usual C style comment */ int i; /* this is going to count things */ …

Member Avatar for Salem
0
380
Member Avatar for jay.barnes

Hello! I have a text field where a user can enter either a(n): [LIST] [*]American zip code (example: "02475") [*]Canadian zip code (example: "A3F 4G6") [*]A "city/state abbreviation" combination (example: "Toronto, ON", or "Las Vegas, NV") [/LIST] For the most part, users don't have much of a problem with the …

Member Avatar for Airshow
0
223
Member Avatar for stewie griffin

I trying to get text only from html code (no tags and exec) I used the next command (regular expression): htmlSurce = htmlSurce.replaceAll("\\<.*?*\\>", ""); it works fine but all the text between <!-- --> is not removed how can I remove it???

Member Avatar for stewie griffin
0
213
Member Avatar for deerowbear

Hi there, I was curious why I am getting an out of bounds exception in this code. Any pointers would be very helpful. Thanks daniel [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; /* Data Structures Infix2Postfix: Ex. 23.6, pp. 1208 OR Ex. 25.6 Page 1363 OR Ex. …

Member Avatar for deerowbear
0
259
Member Avatar for squarey

Hi Guys I am writing a function using boost.regex. It should return false if no brackets are found, true if there is a complete match and an exception is thrown if an odd amount of brackets are found (i.e. only opening bracket but not closing bracket). The problem is it …

0
49
Member Avatar for squarey

Hi Guys, I am trying to write some regex to process a string. I have been reading up the boost documentation and noticed there are many differences between the way C++ regex is written and the way I am used to writing regex in web apps (J2EE, PHP etc). Can …

Member Avatar for Narue
0
82
Member Avatar for ticktock

I am currently creating a registration form and it contains error handling processes for the text boxes, like certain characters are only allowed in a certain textbox and so on. So for my first try I tried creating an algorithm that will check if the user only enters letters from …

Member Avatar for ticktock
0
180
Member Avatar for DexterID

Hi, I tried so much working with this to get distinct Words and their count. I'm using ASP.NET 2.0. And i also googled so much. I need HELP from anyone to get the required output. 1)Ex(String): The DOTNET is Very Cool! The Best. 2) Capture all the sequences like Spaces, …

Member Avatar for kvprajapati
0
101
Member Avatar for diafol

Hi folks, I'm looking for a function, similar to str_replace that replaces just the first occurance of a specified string. I have found such a function: [url]http://www.help2go.com/Tutorials/Programming/PHP_:_How_to_replace_only_the_first_occurrence_in_a_string_with_str_replace.html[/url] However, this does not take into consideration of 'search from an initial position'. My interest is with regard to replacing strings within a …

Member Avatar for diafol
0
176
Member Avatar for julseypart

hi, i have a gridview search which filters the gridview, displaying the search results, however it wont highlight the results in yellow: [CODE=c#]//Highlight relevant search results public string Highlight() { //Declaring a variable to hold search query string s = txtSearch.Text; if (s != null) { //string Search_Str = txtGrid.Text.ToString(); …

Member Avatar for kvprajapati
0
204
Member Avatar for ZoMbiESsSZ

HI Guys. I'm trying to make my own lite program that can highlight specified chosen words (Syntax highlighting in short). I have a working method using Regex, but it is TOO SLOW. Here is what is currently: My Regex Statements: [CODE] public Regex SettingsAndComments = new Regex("--settings|-|", RegexOptions.IgnoreCase); public Regex …

Member Avatar for kvprajapati
0
283
Member Avatar for gridder

Hi, Wonder if anyone here can help with this: I'm trying to split each line of data from a text file into a list or tuple. The lines contain a mixture of ints, floats, and strings (with spaces). I can do it easily enough using split() twice - once by …

Member Avatar for gridder
0
124
Member Avatar for MrYrm

Hi all, As a learning project I'm rewriting a spider i have in php to c++. One part of the spider is a multi-threaded downloader, all this downloader does is read urls from a text file download the page and save it. I would like the downloader to strip out …

Member Avatar for MrYrm
0
83
Member Avatar for semanticart

Hey guys i have the following code and i need to be able to look through a section of html and pick out all the elements that have the classname cmsedit. The code below does that however if the element has new lines or tabs in it ect the the …

Member Avatar for cwarn23
0
101
Member Avatar for MansonASP

My first post ever anywhere! :) As a novice I may be asking a stupid question here. Although arraysize exists, postcode array doesn't when I try to work with it in the addToArray method (and yes I know there are some other issues but I'll sort those later): [CODE]namespace Postcodes …

Member Avatar for MansonASP
0
249
Member Avatar for tjsail

Hey guys, so i've posted here before about regex, and i was told that some of you may be able to check my regexes for errors after i have created them. I have one that looks like it should work to me, but it absolutely will not. [code] public static …

Member Avatar for ~s.o.s~
0
114
Member Avatar for Krstevski

Hello... I have problem with regex, I want to get the tables from another site... the regex is re.compile(r'<table.*?>(.*?)</table>') but when I get the tables I don't know how to return the value into the tables. [CODE=Python] #html = the page tbl = re.compile(r'<table.*?>(.*?)</table>') return tbl.sub('', html) #return html without …

Member Avatar for Krstevski
0
84
Member Avatar for Slammer

Hi, my problem is in regular expression. I need to catch from html code hyperlink tag's href atribute content if this hyperlink contains search condition. here is snippet: [CODE=php]$a = "nail"; //search ctriteria between <a></a> $s =<<<EOF <a class="level2" onmouseout="this.style.background = '';" onmouseover="this.style.background ='#2c7cf4';" href="index.php?item&amp;module=1&amp;category=11" style=""> kaut kas cits </a> …

Member Avatar for Slammer
0
128
Member Avatar for sakhi kul

Hi, I am trying to validate a simple form using jQuery. So,I created database company and in that my table manager. here I am trying to add manager record. the code is here- AddManager.aspx file [code] <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Formvalidation.Models.manager>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> AddManager </asp:Content> <asp:Content …

0
85
Member Avatar for bloodreign39

I am having some problems with my java code, i am trying to write a C compiler and am currently working on developing a string tokenizer for the C programming language using java regex. my problem is first my program wont recognize multiline comments and second i cant figure out …

Member Avatar for musthafa.aj
0
202
Member Avatar for cali_dotcom

i need some help with logic here. i am reading contents with ob_get_contents. then i need to search for and fetch the contents and id's in a custom tag. eg: <translate id="4" token_id="0" variant_id="1">contents............</translate>. i wanted to do that with preg_match_all but it get complicated trying to fetch the id's. …

Member Avatar for cali_dotcom
0
139
Member Avatar for mpegjohn

Hi, I am running 3 threads that each start an ffmpeg process to extract 3 snapshots form a video file. I need to be able to call this method multiple times, with different video files. It writes the three snapshots to the system. However If I try to delete these …

Member Avatar for mpegjohn
0
339
Member Avatar for cwarn23

Hi and I have the below php-gtk script but for some reason it is reporting the error "Not enough storage is available to process this command." in the command console but the application still loads. It only happens when I try to import a 1.75MB text file for processing. Does …

Member Avatar for cwarn23
0
189
Member Avatar for SergioQ

Am embarrassed to ask this but RegEx is really my kryptonite. I have a RegEx line that extracts just numbers from a string. However, I need to tell it that I only want the numbers that come BEFORE a specific set of characters, let's say SDCSDC. Any numbers after that …

Member Avatar for d5e5
0
169
Member Avatar for raafi007

Hi, I need regex to ignore strings having < followed by a letter. But everything else is allowed abce <a <a asdfj<aasdfasdfsd Thanks in advance

Member Avatar for Tschuikow
0
66
Member Avatar for kadvar

Hi, I'm trying to match patterns of the types sentence1 = "keywords=walter&keywords=scott" sentence2 = "keywords=john&" sentence3 = "keywords=james&keywords=john&keywords=brian&" so basically the keywords=somestring& part can be repeated once or multiple times. I am trying to extract the string(s) between '=' and '&'. I have come up with the following so far. …

Member Avatar for woooee
0
90
Member Avatar for voolvif

Hi, I'm trying to use regular expressions on a log file and am trying to extract search terms. Each line in the file is of the form: [CODE]mystring = "00:00:11 192.168.21.44 GET /images/help.gif - 200 Mozilla/4.0+(compatible;+MSIE+5.0;+Windows+98;+DigExt) ASPSESSIONIDGGGGGQEG=CLDIHIJBJAPFAGBFIOMCFGGA;+PRO%5FOnline=SEARCHQUERY=%09%3Cinput+type%3Dhidden+name%3D%27HrowColumns%27+ID%3D%27HrowColumns%27++value%3D%271%3B6%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData10%27+ID%3D%27txtScopeData10%27++value%3D%27[COLOR="Red"]catherine[/COLOR]%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData30%27+ID%3D%27txtScopeData30%27++value%3D%27[COLOR="Red"]porter[/COLOR]%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData50%27+ID%3D%27txtScopeData50%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData11%27+ID%3D%27txtScopeData11%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData31%27+ID%3D%27txtScopeData31%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData51%27+ID%3D%27txtScopeData51%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27HCollection%5Fid%27+ID%3D%27HCollection%5Fid%27++value%3D%271%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27Submit1%2Ex%27+ID%3D%27Submit1%2Ex%27++value%3D%2736%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27Submit1%2Ey%27+ID%3D%27Submit1%2Ey%27++value%3D%2718%27%3E%0D%0A http://www.foo-bar.com/SearchResult.asp"[/CODE] I have put the search terms that I'm trying to extract above …

Member Avatar for bvdet
0
190
Member Avatar for lllllIllIlllI

Regex is one of the more complicated modules that you can use in python. Once you have learnt it though you can use it many different programming languages, so its a useful tool for using with strings. So first to use regex you must import it [code] import re [/code] …

Member Avatar for bunkus
3
2K
Member Avatar for P00dle

I'm reading a whole xml file in as a string. Some of the Node values are directories, e.g. "C:\" When I print out the string, to make sure that the file has been read in correctly, I see that it has completely ignored the Nodes that have directories in them. …

Member Avatar for P00dle
0
88
Member Avatar for IcetalkeR

Here's a example page: [URL="http://dictionary.reference.com/browse/funny"]http://dictionary.reference.com/browse/funny[/URL] What i need is this: [CODE]ndex">1.</td> <td>[B]providing fun; causing amusement or laughter; amusing; comical:[/B] <span class="ital-[/CODE] Definition and part of speech. Could you help me with extracting that info from the "tag jail" ;)

0
54
Member Avatar for TheWhite

I want to parse a string into something like an array: [url]ftp://user:pass@host:portpath[/url] [url]ftp://anon:1234@111.222.333.444:9999/path1/path2/[/url] I read the java docs about using Pattern and Matcher but I keep getting an "IllegalStateException: No match found" error. [CODE=java] import java.util.regex.Matcher; import java.util.regex.Pattern; public class test { public static void main(String[] args) { String s …

Member Avatar for TheWhite
0
437
Member Avatar for P00dle

I had a couple of posts on getting this thing to work. I finally got a small test program working, but now this, the actuall program, doesn't. I don't understand the error either(Will include it at the end of this post). Here is my code, with the line throwing an …

Member Avatar for parry_kulk
0
194
Member Avatar for makdu

Hi all, I am new to c#. I am trying to read a text and find a string from that text file. I want to get the text between two particular line number . Intially i want to get two particular string's line number . then the text between these …

Member Avatar for jonsca
0
2K
Member Avatar for genieuk

Hello, I have 3 text boxes that users can enter there AIM, YIM nickname and MSN email. Once submittd it sends and stores in MySQL db. I will use mysql_real_escape_string() of course but am not sure what is the best way to ensure no other mailicious code has been entered. …

Member Avatar for genieuk
0
168
Member Avatar for voolvif

Hi, I'm trying to parse an apache log file and match the IP addresses in it. This is my code so far: [CODE] import re ippattern = re.compile(r"\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b") def matchmyip(): if ippattern.search(line): matchedip = ippattern.search(line) print matchedip.group() [/CODE] Now given a line like this from a log file: [CODE]1999-08-01 00:00:00 …

Member Avatar for voolvif
0
3K
Member Avatar for NargalaX

Hey, I am using a messenging system to do math, and I am in need of help for my string splitting. What I need it to do, is basically see if there is a '/' '*' '+' or '-' and split it from that charectar, and ALSO split it in …

Member Avatar for farooqaaa
0
169
Member Avatar for jen140

Hello all. I have a small problem, the next code finds the neden content, but it doenst print it: [CODE]$string = "#324423asdd asd 'BecamePosters' "; if($string =~ m/'[a-zA-Z]{1,40}'/) { print "ok!\n"; print $1; } else { print "not ok!\n"; }[/CODE] It only prints "ok!\n" but nothing more. Also triyed m/'*'/ …

Member Avatar for jen140
0
101
Member Avatar for Um num num

I used regex a bit before but never got the hang of it. I need some help with few problems. My net is very limited for now so I can’t browse and look for answers so if anyone can help me with this ill appreciate it 1) For one text …

0
71

The End.