1,034 Topics
![]() | |
Regex to match the dd/mm/yyyy date format. | |
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. … | |
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 | |
![]() | 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 … |
[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 … | |
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 … | |
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 … ![]() | |
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] | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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); … | |
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? … | |
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 .* \ / … | |
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) ------------------------------------------------------------------------------ … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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] <> … | |
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 … | |
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 … | |
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 = … | |
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] … | |
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)"); … | |
I am trying do a search and replace with Dreamweaver and regex. Specifically, I am trying to replace all the ' with ' but it keeps inserting &apos; I can't find an option to change or anything else. Does anyone know how to escape the ampersand or where the option … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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: … | |
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) # … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 |
The End.