1,034 Topics
![]() | |
Hi everyone! i try to make a regualr expression format to validate phone number at this format: (555) 555-5555 [CODE] Dim IsPhoneValid As New System.Text.RegularExpressions.Regex("^/([0-9]{3}/)*[0-9]{3}*[0-9]{4}$")[/CODE] but it doesn't not work....somebody helps me out.. | |
I try to match 01010 with /010/ but there is one return ([B]010[/B]10) for this match. There are actually two match (010-is common-10) in that string with regex. I used /010/g but againit returns just one match. Is it possible to match this regex twice with such string? | |
I try to have a regex that has at least constraint in a string like "a string has at least two 'a' in it" and possibly "a string has at most three 'a'". Do you have any suggestion how to do it? Thanks for any answer? | |
Hello all! I am working on a regular expression to be used in descrambling words in my scrabble solver. What I am attempting to do is write a regular expression that can be used to find all characters within a scrambled word, irrespective of order and match them to a … | |
Hi I am trying to validate a URL in-putted by the user to check whether it is syntactically correct. [CODE] #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <regex.h> printf("Enter the website URL:\n"); fgets(str, 100, stdin); if (!strcmp(str, "\n")) { printf("Empty URL "); exit(2); } regex_t regex; … | |
I'm just going to put this out there. I was asked to create a spreadsheet with data extracted from MARC records. I have looked at pymarc and cannot get this to work. To be honest I'd rather do this myself and lean something in the process. I have another similar … | |
Yo guys heres my code: Im trying to extract one line each time the sub is called and if no more lines re-set to 0 and start again Problem is that it does not increase even tho i have set it as an array, still brings up he first line … | |
[TEX]in html java script[/TEX] [CODE]var string = "anystring0001enabled"; alert(string.replace(/\D/g, ""));[/CODE] [TEX]in c#[/TEX] [CODE]string[] numbers = Regex.Split("anystring0001enabled", @"\D+"); foreach (string value in numbers) { if (!string.IsNullOrEmpty(value)) { int i = int.Parse(value); } }[/CODE] | |
very hard regex extraction for me :( im trying toextract JOHNDIGEDY which is a variable HTML String: [CODE]<a onclick="showPersona('persistentNation'); return false;" href=""><span>Welcome,</span> JOHNDIGEDY <span style="color: red;">(Unverified)</span>[/CODE] any one help? ive tryed [CODE]Dim Regex As New Regex("</span>\n\n"".*""\n<span style=", RegexOptions.Multiline) For Each M As Match In Regex.Matches(data) Dim Description As String = … | |
Hey guys, Name input value should be entered as shown on credit card eg. 'John P Smith'. I'm trying to prevent 'Aaaaa B Ccccccc' being sent to the sever. Any suggestions appreciated. I'm pritty sure the var rep=regex is causing the script to hang on the first if it acctualy … | |
I want to create a regular expression that matches with the string "B. Hello" or "C. Hello" and so on.. I tried number of things and finally came up with this [CODE]String REGEX = "[A-Za-z]"+Pattern.quote(".")+" Hello";[/CODE] but still no luck.. I tries using '\s' for space but still not working. … | |
Hello I'm writing a little program to check if a postal code is valid or not and I'm using while loop and if statement this is the code: [CODE]final String REGEX = "[A-Z&&[^DFIOQU]][0-9][A-Z&&[^DFIOQU]] [0-9][A-Z&&[^DFIOQU]][0-9]"; output.println ("Please Enter a Valid Postal Code: "); String postal1; String postal2; boolean isCorrect = false; … | |
Hi, I need some deep knowledge Regex Vs Dom. Is Regex much faster then Dom or not? Like processing speed, reliable or not . If any one share link or article it helpful for me. | |
Hi all i want to check regular expression of a text field value i.e. it should not contain any '.,@' and other special characters except '_' and '-'. How can i write my rule in [code]preg_match()[/code] ? | |
In this string "13 12", I like to find if there is an occurrence of '3', but I am not interested in char '3' which is part of "13". In other word I am looking for number 3 not 13. By using the following code in python I always get … | |
Hi all, I want to replace these charachters: Æ,Ø,Ã…,æ,ø,Ã¥, with, AE,OE,AA,ae,oe,aa I thoght I could use preg_replae this way to accomplish that, but if i write this word in the form: "Bælter" - All that is left to be inserted into the DB is "B" - So I am removing … | |
![]() | ok i'm not sure if i can use regex to do this it'd be great if you can give some suggestions! i have a list of pure numbers in one hand and another list of also numbers but with dashes. it's like this: list1 = [245366556346,4534525326562,56345254234237... list2 = [75465-54224-4,3-55-342526,.... as … |
Am, with baby steps, becoming acquainted with the boost library. So far I'm compiling examples. From the tutorial, there is a very short regex-example, mostly there to test that the library is linked correctly: [CODE]#include <boost/regex.hpp> #include <iostream> #include <string> int main() { std::string line; boost::regex pat( "^Subject: (Re: |Aw: … | |
Hi We have moved our site with a new system with a new structure. the domain is the same just structural changes, and I cant seem to get the htaccess right. Here is what i am trying to accomplish: move this: [B][url]http://www.domain.com/chairs/519.htm[/url][/B] to: [B][url]http://www.domain.com/catalogsearch/result/?q=519[/url][/B] we have over 5000 links so … | |
Sometimes ago with the help of some programmers I wrote a piece of code to parse result from ebay's website, title, item number, bids, price sold and date. This is the regex that used to work to get the title of an auction that ended with a sale. [CODE]$match_count1 = … | |
Hi all, I need help with one script. If i Have string like [CODE]$str = "0001564[B]A[/B]58749655[/CODE] I need to find that [B]A[/B] in this string, and count which number is it (When tha A is on the third place, return 2 [starting from 0]) A think regular expression will be … | |
Hi, suppose I have a file named [B]first.txt[/B] from which I want to read. Suppose the text file looks like this: [quote] I like you. I feel your soul. [/quote] Now if I use this: [code] open cool, "< first.txt"; print <cool>; [/code] the entire file content is printed, but … | |
I am learning regex in php but want to try out how the regex in python works. I have not yet moved to the code side of things and for the same reason, i am searching for the regex examples in both php and python. To start somewhere, i decided … | |
Hy I want to validate expression as such: [code]AO:10 EM:1 IO:102 AO:SA EM:SA,AKA,LLMN[/code] so on... I'm noe to Regex and i came out with the following function: [CODE] public void checkFormat(String line) { String expression = "^[ACEILMNOU.]{2}+\\B[:]{1}+\\w{2,4}+"; Pattern subscriptionExpretion = Pattern.compile(expression, Pattern.CASE_INSENSITIVE); Matcher matcher = subscriptionExpretion.matcher(line); if(matcher.matches()) { System.out.println("matches " … | |
[CODE]string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Admin\Desktop\ID.csv"); string sPattern = idBox.Text; foreach (string s in lines) { if (System.Text.RegularExpressions.Regex.IsMatch(s, sPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { nameLabel.Text = "test success"; } else { nameLabel.Text = "test failure"; } }[/CODE] This is basically what I have so far. I am using Visual C#, which is probably obvious, but … | |
Hi all, I wanna extract a certain link from a web page using python regular expression. The scenario is like this.. The code: blah... ... .... <div class="test" src="[B][url]http://www.test.com/file.ext[/url][/B]" style="top:0px;width:100%;" .... blah blah blah I wanna extract the url "http://www.test.com/file.ext" from the page using python regular expression. Thanks in advance! | |
Im a completely retarded person when it comes to creating regex patterns! I want to check a users input, and allow certain urls, so here I have half of a pattern I have put together - Well it is actually the whole bit, but im missing bits and parts to … | |
M trying to connect to a site using the following code. But not able to. Please help [CODE] this.req = (HttpWebRequest)WebRequest.Create("http://wwwd.way2sms.com/auth.cl"); this.req.CookieContainer = new CookieContainer(); this.req.AllowAutoRedirect = false; this.req.Method = "POST"; this.req.ContentType = "application/x-www-form-urlencoded"; this.strNewValue = "username=" + ckuser + "&password=" + ckpass; this.req.ContentLength = this.strNewValue.Length; StreamWriter writer = new … | |
[B]Background:[/B] An application that opens a file, searches the file for the old password, replace the old password, and then saves an closes the file. The file is used by another process. [B]Servers [/B] I have two environments one for dev and prd. [B]The Issue[/B] * On prod the files … | |
Hi all, I am dealing a small issue. I am missing something silly :). My need is that I want the entire lines between <TABLE> </TABLE> with no modifications. [CODE]<?php $some_string = <<<STR <HR noShade size=2> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR="" > <TR BGCOLOR="c1ffcc"> <TH ALIGN="LEFT" COLSPAN=22> <font face="Arial,Helvetica,Geneva,Swiss,Verdana" size="2" … | |
I have clients who send email messages to a specific e-mail address, and i have a script that will automatically update the MySQL table with that data from that e-mail and will publish it to a web page. Images inserted into the emails cannot be seen on a web browser, … | |
Hi, I have a registration form and several codes for validation but i can't join them. regsitration form: [CODE] <?PHP include 'topo.php'; ?> <!-- content --> <div class="indent"> <h2> Inscrição </h2> <form action="envia.php" method="post" onsubmit="return validar()" > <fieldset> <legend> ALUNO </legend> <br/> <div class="field"><label>Username*: </label><input type="text" size="30" name = "username"/></div> … | |
Dear Experts I have following codes, it works fine to sum. but when I enter these values 2100.49+100.20 then it says 2,200.6,899,999,999,996 insted of 2,200.69. How to overcome this problem. Please help [CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="language" content="english"> <meta … ![]() | |
Hello Guyz, I could not found any Forum for Web Servers or something related to my problem so I am posting it here. So I am having trouble with Regular Expressions in HTACCESS. So what I have in my website is : [B]ROOT : (my web root is in a … | |
hey there, I am trying to test strings using regex to make sure that the string may represent a monomial. that is, it must be 123123213x^213123. I am having difficulties to find any helpful information on how to test for ^. I am trying this: [+|-][0-9]*[.][0-9]*[x\^]? but I get a … | |
Hi, im making my new CakePHP project and I've got some problems with validating data, which comes from form. I mean i do know how to add custom rule but i don't know how should regex for 9 numeral telephone number looks like. [code] function checkPolishNumber($inputValue){ $regex = 'what to … | |
I need to parse this document with email ids and convert them to a csv file... source. [CODE]xxxx@xxx.com; hello@gmail.com; John (john@hotmail.com);[/CODE] and so on.....lots of emails are there :D output: [CODE]NickName, Email ,xxxx@xxx.com ,hello@gmail.com John,john@hotmail.com[/CODE] Please help me. This aint a homework. Im trying to recover my emails... hehe. I … | |
Hello everyone, I'm trying to get some text via a C# console app from a web page. The text I'm trying to get is the current players from our Battlefield 3 server we are renting. The url is: [url]http://battlelog.battlefield.com/bf3/servers/show/bcc85e8a-c2fd-41a4-98f4-21548297a9b1/[/url] Obvious, the text I need is this: [url]http://prntscr.com/4qbiz[/url] I have some … | |
For now the code isn't to complex. Built in Netbeans 7 java 6.... just the basis for now but its very safe connection so thought i'd post it for anyone who needs it. A quit command may be sent to any client by specifying its ID and then press enter … | |
Hello... I'm working on a program that gets some info about a certain web page. But one of the features is it needs to find all the links to other webpages on THE SAME site (I think its called an internal link... not sure). I already figured out how to … | |
I have several strings that I want to split using different delimiters such as ",{}() [CODE]$ppl[0] = "Balko, Vlado \"Panelбk\" (2008) {Byt na tretom (#1.55)}"; $ppl[1] = "'Abd Al-Hamid, Ja'far A Two Hour Delay (2001)"; $ppl[2] = "'t Hoen, Frans De reÑŒnie (1963) (TV)"; $ppl[3] = "1, Todd \"5 Deadly … | |
Hello, I'm new to the whole regex thing, and I'm having trouble understanding the syntax. I have to separate a line by different criteria like spaces, brackets and others. Here's and example line: "$#*! My Dad Says" (2010) {Code Ed (#1.4)} 2010 What I want to have is: $#*! My … | |
Well is there any built-in function to do this ?, or 3rd party library EXAMPLE code [CODE]source := Sock.Get('http://www.google.com/'); if source('Google Search Engine', a) > 0 then begin NeededPattern := GetPattern(source, '<font>','</font>'); result := neededPattern; // will display ABC of the <font>ABC</font> end;[/CODE] Then it will get the middle of … | |
Hi all here is my problem, I have a text area in html page containing a long html code. like [CODE]some code ..... ....... <input type="text" name="mobile" value="1234567890"/> some code ..... .......some code ..... .......[/CODE] From that code present in the <textarea> i need to extract following line <input type="text" … | |
hi mate. i have problem about REGEX this is my simple code [CODE]<?php $teks="hi whats up? how are you?"; $replace=preg_replace("/(you)/i",'<span style="background:yellow;">\1</span>',$teks); echo "$replace"; ?>[/CODE] what the mean \1 ? its not give effect for my text.. if i change the value to \2, the text has change.. thanks mate! ![]() | |
GOOD DAY .NET PROGRAMMERS!! ^_^ [URL="http://www.daniweb.com/forums/attachment.php?attachmentid=23184&stc=1&d=1323465600"]http://www.daniweb.com/forums/attachment.php?attachmentid=23184&stc=1&d=1323465600[/URL] I'm having a problem with SMS APPLICATION "see the picture"? when i click the SEND button after typing the number of the recipient and the text messages it's not responding same as the LOAD button and nothing happens after that so i have no … | |
I try some codes snippet from boost spirit, but it only incur a lot of error mesasges [code] #include<iostream> #include<string> #include<boost/spirit/include/qi.hpp> void spirit_01() { namespace qi = boost::spirit::qi; std::string input("1.0,2.0"); std::pair<double, double> p; qi::parse(input.begin(), input.end(), qi::double_ >> ",">>qi::double_, p); //#1 } [/code] After some struggle, I figured it out the … | |
Hi, I need to concatanate lines based on regex. Lines to be concatanated are scattered. All lines begin with number$number$number$number$sentences. There is nothing to mark the end of sentence, only the beginning. Here is an example. I want to rewrite this one [CODE]2 $5$233$ check big cat if it have … | |
Hi I have a String as "ABC("zscxfdb") OR DEF("ghg5dfg5") OR GHI("sdghrhrhr"). I should take the String present inside DEF() alone.. Can anyone help me in this.. Thanks in advance... | |
I would love to know, if it's possible to get a specific data from a specific mysql table.. Let say on the table itself has a Varchar ... mixed of words and floats.. and then ... I want to pull only the float from the table using php... can it … |
The End.