1,034 Topics

Member Avatar for
Member Avatar for xanawa

i want a regex pattern that accepts from 3 to 6 digits.. and only A,M or G at the end eg: 1234G

Member Avatar for samueal
0
109
Member Avatar for adarshcu

[CODE]import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexTest { public static void main(String[] args) { String regex = "([a-zA-Z'-]*[ ]*)*"; Pattern p = Pattern.compile(regex); String input = "Adarsh has been testing this issue for a very long time now!#!"; Matcher m = p.matcher(input); System.out.println("Called"); if(m.matches()) System.out.println("Matched"); else System.out.println("Not Matched"); if(input.matches(regex)) System.out.println("Matched"); …

Member Avatar for thekashyap
0
185
Member Avatar for xanawa

Hi, I need a validation using regex just the pattern i have. The user has to enter digits and after the digits one letter. User can have up to six digits or less eg: 1234(G) 123456(K) 12(O)

Member Avatar for xanawa
0
801
Member Avatar for ssreevidya.m

hai, I want an expression for all alphabets and some special characters like . - ' etc. I use an expression like ^[-_'.,A-Za-z]* but it doesnt contain '. can i get a correct expression for this. Thanks in advance Sreevidya

Member Avatar for shakeb@techwave
0
140
Member Avatar for diafol

Hi all, preg-Replace has stumped me again. I'm just too thick to get it. This is my problem: I have two files. File 'newvalues.php' with an array like so: [CODE].... $lang['this_key'] => 'blah blah blah'; $lang['another_key'] => 'rhubarb rhubarb'; $lang['something_else_key'] => 'twitter twitter'; ....[/CODE] And another file: 'template.php' like so: …

Member Avatar for diafol
0
160
Member Avatar for raghujosh

I am doing a preg_replace on a string and the replacement contains a count variable that needs to be placed inbetween the pattern. But I am having difficulty doing that as the count is taken as a pattern and not as a count variable. Here is my code. $count = …

Member Avatar for vibhaJ
0
123
Member Avatar for raghujosh

How can we establish an or condition in a regex pattern. I would like to match the following in a string ">" OR "/>". How can I do that using regex?

Member Avatar for vibhaJ
0
82
Member Avatar for missc

what is the best regex to validate email. i would like to validate it to be a valid email not ex : [email]abcd@efgh.ijk[/email]

Member Avatar for missc
0
125
Member Avatar for itisnot_me

ok so i am pulling my hair out here trying to figure out why php doesnt want to work right with this reg expression [B] what i am looking for [/B] {blog:name_of_blog} [B]what i have[/B] preg_match_all('\{blog:[A-Za-z0-9_]+\}', $replaced_content, $matches, PREG_SET_ORDER); [B] this is the error it is out putting[/B] Warning: preg_match_all() …

Member Avatar for itisnot_me
0
149
Member Avatar for anish99virgo

Hii all!! Well i want to know about how to check for the password entered by the user in a textbox?? When a user enters some characters in textbox, i want to show a label which will tell about the strength of password, that is it strong, weak , poor... …

Member Avatar for anish99virgo
0
6K
Member Avatar for bharath54321

i want to validate whether given file is text file or not using regex could you please give example

Member Avatar for masijade
-1
57
Member Avatar for Euphan

I've been tasked with reading in multiple emails that are stored in a single archive file and then scanning it to find certain things. My problem now is that I seem to only be reading in the first of the many individual files stored in the single archive. The "archive" …

Member Avatar for Euphan
0
243
Member Avatar for swinchen

I am working on a project that requires me to clean data from a series of RS-232 instruments. These instruments can have a different version number, and output format (both of which can change the expected ouput). On top of that there are flags that determine if certain fields are …

0
140
Member Avatar for umesh314

Hi all , i have a string var containing info like this. [B]STRING[/B] = "Are you posting in the most appropriate place [B][COLOR="Red"]PKG0620_REL_23_Nov_2010[/COLOR][/B] to receive relevant replies" So, my program will ask only "PKG0620" info to be given by the user which i am storing in SEARCH var. SEARCH = …

Member Avatar for umesh314
0
127
Member Avatar for vbx_wx

I'm trying to print all .pdf files from a partition using Boost.Filesystem and Boost.Regex but when I run my program, Visual Studio 2010 gives me an Abort error. Here is my code: [code] path Path = "e:\\"; boost::regex reg("*.pdf"); for(recursive_directory_iterator it(Path); it != recursive_directory_iterator(); ++it) { if(boost::regex_search(it->string(), reg)) { cout …

0
57
Member Avatar for abathurst

Hi all, I'm not the best with coding and was wondering if some one can help me out. The page is inserting information into a database but when i added an extra section to insert i get the error [CODE] Could not find stored procedure 'Insert_PublicationsA'. Description: An unhandled exception …

Member Avatar for bill51
0
534
Member Avatar for terabyte

y/A-Za-z/N-ZA-Mn-za-m/; it is a rot13 script but I don't undestand how it works, what is the y// operator for

Member Avatar for masijade
0
119
Member Avatar for Arikon

I am making an english to pig latin translator and I cannot quite get this right! For some reason i can always get the first word to translate but the other words jumble together and sometimes repeat themselves. The rules for this program are as follows: To translate an English …

Member Avatar for Arikon
0
1K
Member Avatar for qazplm114477

I have spent about a couple of hours trying to read the pcre regex syntax on the php.net manual but I can't for the love of god grasp the concept of it. If anyone can help me it would be greatly appreciated. I'm trying to split some strings into an …

Member Avatar for kekkaishi
0
108
Member Avatar for TheDocterd

Hi All I have a small app. What is does it reads an html file for certain keywords (like e9, e5, e21, etc.) When any of those lines are found it must add a link in html format into the file. Except you will see that the folder locations differ. …

Member Avatar for TheDocterd
0
109
Member Avatar for liamfriel

Hello all, I am trying to use more regex but I can't seem to get this to work. The aim is to check inputs for either [url, [link or <a href: [CODE] $islink = false; foreach($_POST as $k => $v){ if((preg_match("/[url|[link|<a href/i", $v)) > 0 ){ $islink = true; } …

Member Avatar for liamfriel
0
163
Member Avatar for CJdamaster

Hi there, Because of browser wars and whatnot, a lot of CSS3 components have to be written in many different syntaxes to work. E.g. -moz-box-shadow and -webkit-box-shadow (even though they're identical in format) So, my solution is to write simple flags in the CSS file which a PHP script will …

1
57
Member Avatar for russellharrower

So I got most of the code working, but what I am trying to do, is say someone post the following This is a great youtube video [url]http://www.youtube.com/watch?v=pkrM7x0_fcI&feature=channel[/url] what do you think. I want it to turn the youtube link to [url]http://www.youtube.com/v/pkrM7x0_fcI[/url] but keep the text that they typed so …

Member Avatar for vinnyBenson
0
633
Member Avatar for joomphp

hi! i have some html code like this [CODE] The Chihuahua Desert <a href="index.php">Dirt</a> Fest is <a href="/index.php">coming <a/>up, next February 17-19. <a href="http://google.com">Three</a>[/CODE] i want to replace /index.php with [url]http://google.com[/url] and index.php with [url]http://google.com/[/url] and idea how can i do this

Member Avatar for pritaeas
0
190
Member Avatar for crankyslap

"Cross-thread operation not valid: Control 'DataGridView1' accessed from a thread other than the thread it was created on." I've been avoiding multithreading because of this since I started with vb.net a couple of weeks ago but it looks like I have to start using it now. I simply don't understand …

Member Avatar for HookDevil
0
2K
Member Avatar for The Road To Voi

So I've made a Task Scheduling application (for learning purposes). The program currently saves all the data in simple text form. I use Regex to split the data up and assign it to the appropriate variables. I don't really like this way of doing things as it seems messy and …

Member Avatar for williamrojas78
0
271
Member Avatar for blacknred

Hi, I'm trying to 'grep' the string which comprises of all non-zero values [B]0x0000000a[/B] in this case. [CODE]>>> match = re.search('0x0000000[1-9,a-z]', "My values are value=0x00000000 0x00000000 0x0000000a 0x00000000 0x00000000 0x00000000")[/CODE] This works but in this case, but not over any string as in if example is: [QUOTE]"My values are value=0x00000000 …

Member Avatar for blacknred
0
86
Member Avatar for TheWhite

[CODE] import java.util.regex.Matcher; import java.util.regex.Pattern; public class test_regex { public static void main(String[] args) { String text = "(asdf) (123) (zxcv)"; Pattern p = Pattern.compile("^\\((\\S+)\\) \\((\\S+)\\) \\((\\S+)\\)$"); Matcher m = p.matcher(text); if (m.matches()) for (int i=0; i<m.groupCount(); i++) System.out.println(i+".) "+m.group(i)); else System.out.println("no match"); } } [/CODE] [QUOTE] Output: 0.) (asdf) …

Member Avatar for TheWhite
0
222
Member Avatar for crankyslap

Hey guys, I got my application working fine but it's using a constant 50%-ish of my CPU power, which is way too much I believe. Can any of you figure out what's causing this, or tell me how I can find out myself? :) What we're doing is reading a …

0
105
Member Avatar for Suzie999

Hello all. If there is one aspect of any language I cannot understand it is regex. I have some strings I need to parse, of varying length and content, but there are patterns. There 2 base types the first always begins with [B]%zn%[/B] and can be short or long and …

Member Avatar for Suzie999
0
120
Member Avatar for linezero

I am trying to move a match from a match collection to another listbox as string. here is my regex code [CODE]Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://localhost/pos/leftpanel.html") Dim response As System.Net.HttpWebResponse = request.GetResponse Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) Dim rssourcecode As String = sr.ReadToEnd Dim r As New …

Member Avatar for codeorder
1
301
Member Avatar for RoyalElite96

Hello everyone. I am working on this forum/post/script type thing. What I want to do is convert this example to HTML. [div] [p]Some text[/] [div] Some more text [/] [/] ---> <div> <p>Some text</p> <div> Some more text </div> </div> I don't want to use [/div] or [/p] to keep …

Member Avatar for kekkaishi
0
110
Member Avatar for Enzo85

Hello everyone, I am trying to read a .rtf file, does this have to be done using the RTFeditorKit? Can a .rtf file be read line by line like a normal .txt file, as I was planning to read it line by line (as a string) to remove punctuation first …

0
114
Member Avatar for xanawa

Hi, I am trying to use regex to validate an input from JOptionpane i want to allow the user entering ONLY digits, letters and exclametion marks. This is my line of code where i would like to put teh regex. [B]Code[/B] String message = JOptionPane.showInputDialog(null, "Enter a Message: "); Steganography.hide(message, …

Member Avatar for xanawa
0
77
Member Avatar for andyhunter

trying to create a matcher for finding if title is not correct i.e. has to be mr, mrs, miss etc..but this allows mrmrmr etc when it should not. tried different setups to keep failing i.e. [[]] or (). [ICODE] public void valTitle(){ //validate title while (this.title.matches("^[\\s]+$") ||this.title.matches("") ||this.title.matches("[^m]&&[^r]*") ){ System.out.println("Title …

Member Avatar for andyhunter
0
87
Member Avatar for ofir0803

Hi i have this string: [CODE]<div class="col-price"> <h4>you save</h4> <span ><span class="currency">$</span>32</span> </div> <div class="col-price"> <h4>discount</h4> <span >52%<span class="persent"></span></span> </div> <div class="col-price last"> <h4>original price</h4> <span ><span class="currency">$</span>62</span> </div>[/CODE] i want to be able to find the values of: [I]you save[/I], [I]discount[/I] and [I]original price[/I]. the desierd output: 32, 52, …

Member Avatar for kekkaishi
0
144
Member Avatar for tinymark

Hello to everyone. I have an old flat database with a couple of hundred entries that I want to convert to a relational design. It was a user database for simple login and some preferences. I would like to know if there is a simple way to convert from one …

Member Avatar for tinymark
0
181
Member Avatar for perlnoob

Sample content of the file [CODE] PP: Happy Sunday! PP: It's a good weather. PP: Have a blessed Sunday everyone. the output should be HL: Happy Sunday! PP: It's a good weather. PP: Have a blessed Sunday everyone [/CODE] My code to generate that [CODE] $length=@fileinput; if($line=~/PP:\s/) { {if($j<$length) {if($line[$j-1]!~/PP:\s/ …

Member Avatar for d5e5
0
120
Member Avatar for lobstar

Hi, I am using cURL to grab the contents of a webpage which contains a table. I am trying to make an array out of the table contents, with the column headings as the array keys. Unfortunately the first row of the table, before the headers, has pagination which is …

Member Avatar for lobstar
0
472
Member Avatar for reborn2010

Dear Buddies, Need your help to make a simple regex to grab all codes from [B]<!-- Begin Code --[/B]> until [B]<!-- End Code -->[/B] I would like capture this code for deleting in Yahoo pipes. code: [code]<!-- Begin Code --> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: '132829708015487', status: …

Member Avatar for reborn2010
0
182
Member Avatar for pandaEater

I'm new to AJAX, PHP, and Javascript and I'm trying to learn more about them by setting up a user login for a website. I've gotten it working but there are a few problems I'm having trouble solving. Right now the login works, but I'd like to check if the …

0
87
Member Avatar for Perl_enthusiast

Hello everyone who reads this. I am currently creating a program in which the user inputs a booking reference which will allow them to overview flight details that they have added to previosu flights. I have been having trouble working out which direction I should follow to sort out this …

Member Avatar for Perl_enthusiast
0
961
Member Avatar for jaango123

Hi All, can anyone give me the regx expression to be used to search for ip address in microsoft visual studio versions. If I open text files using Visual studio and ctrl+Shift+F, search al open documents, then give the regex, it should list all the ipaddress contained lines at the …

Member Avatar for Jx_Man
0
122
Member Avatar for judithSampathwa

hi there, i may have asked this question several times, but the tel number is being formated in a incorrect way. when the user enters the tel number i run the below code [CODE] public bool ValidateTelNo(string TelNo) { bool value = false; string rePhoneNumber = @"\d{3}\s?\d{3}\d{4}$"; string PhoneNoFormat = …

Member Avatar for judithSampathwa
0
211
Member Avatar for andrewliu

I have a pregexpression and its not outputting anything. Can someone explain why this might be? I'm also new to learning this [CODE]preg_match_all("/\<b>\$(.*?)\<\/b\>/is", $res[0], $match); foreach($match[0] as $value) { echo "<div class='prices' id='kgbdealsPrice'>".$value."</div>"; } [/CODE] The string that I'm trying to get looks something like this [CODE]<tr> <div> </div> <div> …

Member Avatar for andrewliu
0
300
Member Avatar for TheSassyDragon

This is the code at line 23: [CODE] foreach($form->getErrorArray() as $m){ $x .= "".$m." + "; header("Location: Form_Display.php?message=".$x."") [/CODE] Gives me two error messages 1. Passwords don't match 2. Email not entered I've banged my head out, smoked a carton of cigarettes and had a quiet meditation session after raging. …

Member Avatar for joeyxaza
0
241
Member Avatar for magnetpest2k5

Hello all, suppose I have a string which i have retrieved using the regex like the following [CODE] string_feature = '<div class="BVRRLabel BVRRRatingNormalLabel">Customer Rating</div><div class="BVRRLabel BVRRRatingNormalLabel">Value for Price</div> <div class="BVRRLabel BVRRRatingNormalLabel">Picture Quality</div> <div class="BVRRLabel BVRRRatingNormalLabel">Ease of Use</div> <div class="BVRRLabel BVRRRatingNormalLabel">Features</div>' [/CODE] What will be the regular expression to get the …

Member Avatar for snippsat
0
116
Member Avatar for danholding

please bare with me as im a returning newbie and have not really used re.expression much and still get very confused! my problem! i am currently working on a few database records which need appending. this is one of the files i need to resort the data base has now …

Member Avatar for TrustyTony
0
428
Member Avatar for MrCapuchino

Hello I have created a Regex to remove invalid characters in a string: Here it is: [CODE] Regex replace_invalid_caracters = new Regex(@"[\\|/|*|+|-|%|=|^|@|#|$|!|~|`|?|<|>|:|(|)|{|}|;|,|_|]"); [/CODE] The thing is that then I use it in a method to remove this invalid characters. It manages to remove all invalid characters except for "-". I …

Member Avatar for MrCapuchino
0
147
Member Avatar for linezero

I'm trying to use this url as regex but it doesnt seems to be working 'sorry of my bad english' Full code: [CODE]Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://localhost/pos/leftpanel.html") Dim response As System.Net.HttpWebResponse = request.GetResponse Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) Dim rssourcecode As String = sr.ReadToEnd Dim r As …

0
134

The End.