1,034 Topics

Member Avatar for
Member Avatar for kalyanraj
Member Avatar for lm111

Hello, Please help me. So far nobody was able to help. I am trying to assign a dynamically created LinkButton to a string value. I have a function and there is definitely something wrong with it and I need someone to tell me if it can be done or not. …

Member Avatar for anuj_sharma
0
121
Member Avatar for atch

Hi, I'm trying to fork out number from this expression. Obviously without any luck. I wonder if anyone could help and suggest good book about regex. [code=c++] boost::regex reg("[[:blank:]]*move[[:blank:]]*\\d{1,3}[[:blank:]]*, boost::regbase::icase); [/code] Thank you

Member Avatar for atch
0
104
Member Avatar for perlguy

I'm trying to cut off the text leading up to the whitespace past the >. For example the string is 'Web & Programming > Testing & QA Contractor' and my regex is [icode]$job->{'title'} =~ s/^.+>\s+//;[/icode] I need to end up with just 'Testing & QA Contractor'. Can someone point me …

Member Avatar for Amps
-1
76
Member Avatar for TheWhite

[CODE=JAVA] String line = "Extracting from E:\\Junk\\morejunk\\file.txt"; System.out.println(line); //prints: Extracting from E:\Junk\morejunk\file.txt String[] splitPath = line.split("\\"); //exception thrown here String folder = splitPath[splitPath.length-2]; System.out.println(folder); [/CODE] [QUOTE]Exception in thread "AWT-EventQueue-0" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1[/QUOTE] My objective is to always print the folder containing the file being extracted (morejunk …

Member Avatar for quuba
0
1K
Member Avatar for jeffc418

Hi! I have a question that probably has a really simple answer :D. I have a regex that validates names: [CODE]elseif (!preg_match('#^[a-z0-9' -]{1,35}$#i',$lastname )) { include('includes/error.php'); }[/CODE] Only if the name I enter has an apostrophe, it gives me my error message. Can someone please help me modify this regex …

Member Avatar for BzzBee
0
160
Member Avatar for rajachandra

hello, in the below code i have established conection through jdbc to oracle database,here my program will give continous ping to the server and stores the result in to the file. again by opening the file iam reading the file and searching for the "Request Timed out " pattern and …

Member Avatar for harsh2327
0
93
Member Avatar for mansi sharma

Can somebody help me in making me understand the regex function- What these characters means /^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/ [code] function validate(input) { var email =/^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/; if(email.test(input)) { return true; } else { alert('invalid email id'); return false; } } [/code]

Member Avatar for pritaeas
0
79
Member Avatar for devi1977

Hello all, I am new to regex and need some help with my current code. Below's the code I am using and results I am seeing. What I want is for it to match just the line where it sees "ID:". Would be great if I can get pointers on …

Member Avatar for devi1977
0
110
Member Avatar for sheara

In goal settings for Google Analytics, the goal page is this: [url]http://www.mydomain.com/Gallery.aspx?sbmid=745&new=true[/url] But I believe I need to use Regex, because the 745 will always vary, but the rest is the same. Any thoughts?

Member Avatar for sknake
0
44
Member Avatar for perlfan

The following code: Exits immediately and produces the message below when search pattern "[COLOR="Green"]\b\w+{3}\b[/COLOR]" is entered: [code=perl] #!/usr/bin/perl -w #matchtest1.pl use strict; my($pattern); my($true); $_ = '1: A silly sentence (495,a) *BUT* one which will be useful. (3)'; do { print "Enter a regular expression: "; chomp($pattern = <STDIN>); if …

Member Avatar for perlfan
0
137
Member Avatar for codedhands

Hello, i have a problem constructing a regular expression to strip out puntuations from a document.Below is a simple example of my code [CODE=c++] # //headers here //... string a="kennedy .really-really. .cool"; string replace=" "; string newStr; boost::regex expression("[ ]+(\\.)|(\\.)[ ]+",boost::regex::icase); newStr=boost::regex_replace(a,expression,replace); cout << newStr << endl; //output kennedy really-really …

Member Avatar for codedhands
0
89
Member Avatar for alaamido

Hi all I have a big two prblem in Regular expressions The First: In the following string "My name is alaa and his name is is alaa" when I want to match all values that are before alaa so it should return (My name is ) and (My name is …

0
47
Member Avatar for agent154

I'm trying to figure out why the regexp "[A-Za-z0-9\-]+\.jpg|jpeg|gif|png" only seems to find "gif" when I run it on the source of an html file.. For example: I have the following code [code=c#] string URL = "http://www.google.ca"; string re = @"[A-Za-z0-9\-]+\.jpg|jpeg|gif|png"; WebClient wc = new WebClient(); Stream data = wc.OpenRead(URL); …

Member Avatar for agent154
0
131
Member Avatar for agent154

I'm having trouble finding a clear tutorial on how to use regular expressions, and its driving me insane.. However, based on an example I saw, I am trying to construct my own pattern and I cannot figure out why it is not working. Can somebody here give me some help? …

Member Avatar for agent154
0
117
Member Avatar for rayken1

FT CDS complement(join ( 14006...14068, 19351..20068)) FT /locus_tag= TP01_0004” FT /note=”go function: nutrient reservoir activity [goid FT 0045889] The above statement is been read as a string and I would a REGEX as follows: /^FT \s CDS \s \ / complement[0-9]/ # search line 1 /^FT \s .* \ / …

Member Avatar for rayken1
0
194
Member Avatar for codedhands

Hello,i am writing an application which involves invoking multiple threads to pick data from a queue and then delete or pop the retrieved data.My codes work well for this purpose but then my application suddenly crashes with a dialog with the following error message: Debug assertion failed! Program:.... Expression:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse) ------------------------------------------------------------------------------ …

Member Avatar for codedhands
0
214
Member Avatar for farooqaaa

By using Regex I've got links from an HTML Source. But now I want to save these links into a new array so that I can later use them. I mean, I want all the "m.Groups[]" in a new array. Here's my code: [CODE] String html = getSource(); r = …

Member Avatar for Ramy Mahrous
0
141
Member Avatar for Steven_C

Hi all. I need help to write a code which will count the number of words of 3 syllables. I've been able to write the code for counting number of words, and counting number of syllables in a text. However I have tried and written a code for the above …

Member Avatar for Steven_C
0
408
Member Avatar for MonicaClare

hi.. this is my new program .. i want a fix or constant answer like, when the answer in: Student Name: Monica Clare then it proceed to another question.. but when.. Student Name: blah blah then. it shown error_message that it is invalid answer,, .. please help me debugging this …

Member Avatar for masijade
0
151
Member Avatar for farahshafilla

my code : ********uploadImage.jsp************* [code=JSP]<form action="UploadImage" method="post" enctype="multipart/form-data" name="productForm" id="productForm"><br><br> <table width="400px" align="center" border=0 style="background-color:ffeeff;"> <tr> <td align="center" colspan=2 style="font-weight:bold;font-size:20pt;"> Image Details</td>[/code] ******UploadImage.java****** [code=Java]import java.io.*; import java.sql.*; import java.util.*; import java.util.regex.*; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.*; import javax.servlet.*; import javax.servlet.http.*; public class UploadImage extends HttpServlet { @Override public void …

Member Avatar for kvprajapati
0
2K
Member Avatar for beginninphp

Hello, I tried to use regex to search through blablablabla[B][url]http://www.myspace.com/username[/url][/B] by using preg_match('~http://www\.myspace\.com/.+"~',$string,$match); The tilde or lack of was tripping me up... am I even close? I was just trying to extract the username at the end, before it was marked off by a double quote ("). I tried adapting …

Member Avatar for beginninphp
0
109
Member Avatar for Pokenerd

Hello again, I'm trying to create a text field that only accepts numbers, a single decimal, and a dash (for negatives) but only as the first character. I have conquered everything except for pasting, and have no idea on where to begin. Below is the current code (working!) code that …

Member Avatar for Pokenerd
0
138
Member Avatar for Zurompeta

Hi all, Been at this for a while now and finally gave in to seek help. Basically, I'm trying to setup a regular expression for a decimal. Where there's 1 to 7 integers in front of the decimal point, and 1 to 2 after the decimal point. This is what …

Member Avatar for Zurompeta
0
76
Member Avatar for Pokenerd

Hi, I'm somewhat new to C# and I've created a numbers (backspace, delete, negative, and decimal) only text box. However the way I'm testing whether to allow for negative numbers only allows them to be added if they are typed as the first character. Below is in an if statement …

Member Avatar for Pokenerd
0
134
Member Avatar for MrBaseball34

I use TRegExpr v.0.952 and now i want use RegexBuddy, but i can't replace code. Can u help me? [CODE] var Temp: TStringList; Index: Integer; regex: TRegExpr; begin Temp:= TStringList.Create(); regex := TRegExpr.create(); regex.Expression := '(?m)(?g)^ftp:.+'; try for Index:= 0 to FList.Count - 1 do begin regex.exec(FList[index]); if (regex.Match[0] <> …

Member Avatar for FlamingClaw
0
164
Member Avatar for Barefootsanders

Hi all.. .I'm trying to use preg_split but I'm having trouble getting the regular expression I want. What I have now is a long character string, upwards of 200 characters depending on user input. I'm trying to do is break up my string an array, each element in that array …

Member Avatar for somedude3488
0
135
Member Avatar for OmniX

What I require is to replace \/:"?<*>| with a space. I have done similar statements before but I have complete brain freeze at the moment. Hoping one of you can jog my memory. Always hated regex expressions never understood the logic behind them minus the A-Z and 0-9 and then …

Member Avatar for ShawnCplus
0
167
Member Avatar for papanyquiL

Hi all, I'm learning how to format strings. I've made the following code, but the console screen just comes up blank. [code=c#] static void Main(string[] args) { DateTime ci = DateTime.Now; //instance of datetime Console.WriteLine("{0:D}", ci); string info = "Fred Savage- SSN: 143-14-8756 Phone: (281)414-3424 Email: fsavage@blah.com"; string format = …

Member Avatar for papanyquiL
0
162
Member Avatar for erictheking1

Bellow is the code for a button where i am trying to execute an email valiadator before and email is sent. The if statement works great until i enter the msgmail code in it. then i get an invalid expression error. Can someone please help me with this?? thanks [code] …

Member Avatar for sknake
0
327
Member Avatar for vuyiswamb

Good Evening All Am amazed that i cant use the Replace Function , its Probably the long that i had. i have the Following code [CODE] String Username = "Vuyiswa"; String Password = "secret"; String strBody = @"<p>Thank you for using !obooking System <br><br> Username:(Username)<br><br>Password:(Password)<br<br>Kind Regards !oBooking</p>"; strBody = Regex.Replace(strBody,Username,"(Username)"); …

Member Avatar for vuyiswamb
0
117
Member Avatar for toadzky

I am trying do a search and replace with Dreamweaver and regex. Specifically, I am trying to replace all the ' with &apos; but it keeps inserting &amp;apos; I can't find an option to change or anything else. Does anyone know how to escape the ampersand or where the option …

Member Avatar for toadzky
0
97
Member Avatar for njparton

I've been tearing my hair out for 2 days over this, hopefully someone here can help me. I'm trying to scrape the price data off the following webpage: [URL="http://www.morningstar.co.uk/UK/snapshot/snapshot.aspx?lang=en-GB&id=F0GBR04S4X"]http://www.morningstar.co.uk/UK/snapshot/snapshot.aspx?lang=en-GB&id=F0GBR04S4X[/URL] The value I want currently stands at 6.19 (i.e. the NAV value on the right hand side). I currently have a …

Member Avatar for njparton
0
202
Member Avatar for senzacionale

How can i write regex to get all words in string. Example - Travel in Egipt (travel, in, Egipt) - london cca 300 EUR (x cca y eur, where x is londox and y is 300) What regex must look like for this two examples? I need two regex but …

Member Avatar for serkan sendur
0
82
Member Avatar for senzacionale

Hi to all. I have one problem I try to parse some string and get data from it. For example i have three strings "Greece about 2 weeks", "greece" and "grece about 500 eur" Now i want to define regular expressions and check for right format. I need data like …

Member Avatar for ddanbe
0
125
Member Avatar for Edel_

I'm just starting out with PHP so I thought I'd do something simple. I modified an existing bit of code but it doesn't seem to work: [code] <?php $url = $_GET['DLURL']; // Fetch page $string = FetchPage($url); // Regex that extracts the urls from links $links_regex = '/<a[^/>]*'. 'href=["|']([^javascript:].*)["|']/Ui'; preg_match_all($links_regex, …

Member Avatar for Edel_
0
111
Member Avatar for Pachrant

I want to find a series of chars in a string, but I dont know, how to write a regex, please help. I have to find in a string occurrances of 3 or more same chars in a row. IE: "4123478888"// four same chars starts at inex 6 or "321222468"//3 …

Member Avatar for ddanbe
0
50
Member Avatar for ashishchoure

hi , can anyone tell how to define AND operator by regular expression. Actually I want to return match if and only if 2 substrings will appear in string. For example i have string "[B]Successful Logon: User Name: Administrator Domain: Logon ID: (0x0,0x154CB759) Logon Type:2 Logon Process: Advapi Authentication Package: …

Member Avatar for ArkM
0
340
Member Avatar for austinium

Hi, I am new to Perl and am trying to port an old version of checkstack.pl to run on windows, the code iam trying to port is [code=perl] # Usage: # objdump -d vmlinux | stackcheck.pl [arch] # # TODO : Port to all architectures (one regex per arch) # …

0
101
Member Avatar for itsjareds

I'm trying to write a demo page for my site that works completely on AJAX. What I mean by this is that the page will stay the same, but load new pages by changing the <BODY> of the document. I'm writing a script that will take every link and decide …

Member Avatar for itsjareds
0
97
Member Avatar for Kelicula

I need to include a "variable" in my regex that will be different each time it is called. Very fustrated, this would have taken 2 seconds in Perl. Here is my code: [code=javascript] for (y=0; y < response.length -1; y++){ var _row = response[y].split(':'); var str = "_row[1]"; if(str.match("/^"+_inputText.value+"/i")){ _responseText …

Member Avatar for itsjareds
0
13K
Member Avatar for username7260

Ok, i got this so far ... [code] import java.util.regex.Matcher; import java.util.regex.Pattern; public class Testing2 { public static void main(String[] args) { Pattern p = Pattern.compile("[wati]"); String text = "water"; Matcher m = p.matcher(text); if (m.find()) { System.out.print("Found !"); } } } [/code] With that code i got a match, …

Member Avatar for masijade
0
133
Member Avatar for theimben

I run a vBulletin forum and Im trying to write a new BB Code. This would be the syntax: [CODE][parts] http://www.link1.com http://www.link2.com http://www.link3.com [/parts][/CODE] This would then be parsed into: [CODE=html] <a href="http://www.link1.com" class="linkclass">Anchor 1</a> <a href="http://www.link2.com" class="linkclass">Anchor 2</a> <a href="http://www.link3.com" class="linkclass">Anchor 3</a> [/CODE] Im a real regex newbie, I …

0
63
Member Avatar for FallenPaladin

HI, I am trying to construct a regEx pattern to match a UK tax code. The pattern i have created is "^(/BR{1}/|/D0{1}/|/NT{1}/)|^(([Kk]{1}[1-9]{1}[0-9]{2,3})|([1-9]{1}[0-9]{2,3}[LPTYlpty]{1}))" I thought this would match the codes as BR or D0 or NT or K followed by 3 or 4 digits or 3 or 4 digits followed by …

Member Avatar for FallenPaladin
0
1K
Member Avatar for OffbeatPatriot

I configure it like this ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared --enable-unicode --with-opengl and when I build it I get this error. /cygdrive/c/wxwidgets-2.8.10/bk-deps g++ -c -o baselib_appbase.o -D__WXMSW__ -I./src/regex -DwxUSE_GUI=0 -DwxUSE_BASE=1 -D_FILE_OFFSET_BITS=64 -D_LAR GE_FILES -D__WXDEBUG__ -I/cygdrive/c/wxwidgets-2.8.10/lib/wx/include/msw-unicode -debug-static-2.8 -I./include -Wall -Wundef -Wno-ctor-dtor-privacy -ggdb -O0 ./s rc/common/appbase.cpp In file included from ./include/wx/memory.h:16, from …

Member Avatar for tux4life
0
380
Member Avatar for evildrome

Hi All, I've got a VC++ dll with Boost 1_34_1 regular expressions in it. I am a programmer but not VC++ or Regex. The program worked fine until the target HTML format (sPage) was changed and I need to get the regexs updated. I got them updated OK. I checked …

0
45
Member Avatar for jyotiu

Hi all I am writing a curl script for collecting information about some sex offenders, i have developed the script that is picking up links like given below:: [url]http://criminaljustice.state.ny.us/cgi/internet/nsor/fortecgi?serviceName=WebNSOR&templateName=detail.htm&requestingHandler=WebNSORDetailHandler&ID=368343543[/url] now when we go on this link i want to get information under all the fields on this page like Offender …

Member Avatar for chetanrakesh
0
74
Member Avatar for amorphis88

I need an email validator in C#... i never written a letter C#... i found this: public static bool isEmail(string inputEmail) { inputEmail = NulltoString(inputEmail); string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"; Regex re = new Regex(strRegex); if (re.IsMatch(inputEmail)) return (true); else return (false); } but do i need …

Member Avatar for amorphis88
0
101
Member Avatar for kelechi96

I need someone to explain to me this code step by step: [code=cplusplus] /* File config.txt: num = 123 str = hello flt = 12.2 */ #include <iostream> #include <fstream> #include <sstream> #include <string> using namespace std; struct Config { int num; string str; double flt; string myadd; }; void …

Member Avatar for Ancient Dragon
0
141
Member Avatar for arya6000

Hello If we have code like this [CODE]$content =~ m/test/;[/CODE] than it will return true or false, but how can I put a match of a regex into a scalar instead of it returning true or false? Thank You

Member Avatar for KevinADC
0
77

The End.