1,034 Topics

Member Avatar for
Member Avatar for KimJack

Hello All, I have working for this simple little thing for the past few days and I am stuck. Can anyone tell me or explain a regex formula that will extract words from xml. [B]Example:[/B] <person> Sue Smith <age> 32 </age> <sex> female </sex> </person> <person> John <child> <name>Jim</name> <age> …

Member Avatar for Ezzaral
0
95
Member Avatar for abar_sow

can anyone explain wat this program is abt. ? [code] import java.util.regex.*; import java.lang.*; import java.io.*; import java.util.*; public class ReadPara { public static void main(String[] args) { CharSequence inputStr; inputStr = "a\r\n\r\nb"; // Windows // Compile the pattern String patternStr = "(^.*\\S+.*$)+"; Pattern pattern = Pattern.compile(patternStr, Pattern.MULTILINE); Matcher matcher …

Member Avatar for masijade
0
116
Member Avatar for Exelio

hi all, I am working in a windows application. i have a text say for eg, <img src="http://static.ibnlive.com/pix/sitepix/06_2007/kumaraswamy_cm90.jpg" alt="BACKTRACKING? Kumaraswamy says he never said he would step down on October 3." title="BACKTRACKING? Kumaraswamy says he never said he would step down on October 3" border="0" width="90" height="62" align="left" hspace="5&"/> Kumaraswamy …

Member Avatar for Exelio
0
112
Member Avatar for jobs

[code=python] s1 ='999' s2 = '99.99' mypat = re.compile('(^([0-9]+[.]+[0-9]+)|([0-9])$)') rate= mypat.search(s1) print rate.group() >>> print rate.groups() ('9', None, '9') >>> rate=mypat.search(s2) >>> print rate.group() 99.99 [/code] I need to get price = float(rate.group()). Price=999 or Price=99.99. I think there is a problem when s1='999', when I do this: [code=python] >>> …

Member Avatar for ghostdog74
0
108
Member Avatar for jricklefs

I'm New to the VB.Net environment this is the fist program I've attempted to write. I am trying to display the first 150 records into a datagrid and then write the first 150 and the entire file into a CSV file and I'm stuck. I need to keep the column …

Member Avatar for binoj_daniel
0
87
Member Avatar for fishhaddock1

Hello... I am trying to use mod_rewrite to send all traffic that isn't going to the directory /catalog to the /test directory I tried a combination of ReWriteCond and Rewriterule:- rewriteCond %{REQUEST_URI} !(^\/catalog.*) [NC] rewriteRule (.*) /test/$1 [R] This is working inconsistently, however.... /catalog gets rewritten, although I want it …

0
65
Member Avatar for bergy_nj

hi.. can anybody help me to have more efficient code.. i tried to do some simple regex to split an URL i tried to do this on my own many times but i couldnt seem to get it right i havent master regex yet..(im learning - but the learning curve …

Member Avatar for bergy_nj
0
116
Member Avatar for wireshop

I've got this script to validate phone numbers. I want to allow numbers 0-9 and the characters -,(,) and + the following seems to only work if the input is all numbers and spaces. Suggestions? [code] if(!ereg("^[0-9\-\(\)\ \+]+$", $phoneNumber)||empty($phoneNumber)){ print'Please enter a valid phone number' ; $error++; } [/code]

Member Avatar for clearstatcache
0
148
Member Avatar for jd2008

for e.g. [url]www.doheth.co.uk/music/lyrics.php?s=30346[/url] -...pls help me create the regular expression...there are few other strings which starts with www and eds with -, is there a way to store strings which matched in an array ?..pls help...

Member Avatar for iamthwee
0
69
Member Avatar for Blackred

This is really a regular expression question opposed to a .NET but I can't see any forum that specialises in that kind of thing, so as I'm using ASP.NET I figured I'd post it here ;) I have a string as such... [code]<ul> <li> <a href="Welcome.aspx">Welcome</a> </li> <li> <as href="About.aspx">About …

Member Avatar for Infarction
0
99
Member Avatar for belhifet

Hi i'm using the Net::POP3 module for reading my email, but it doesn't feature a method that lets you get the body of the email directly. So I have to construct a regex in order to get it. The problem is that I can't get it right. I want to …

Member Avatar for masijade
0
81
Member Avatar for bergy_nj

Hi.. im a newbie in shell scripting, and also new in this forum.. i understand the command below is just reading from /etc/passwd and getting whatever in field 1 and 3 (which are username and userID) after the cut the format will be username:uid my guess,its making the array with …

Member Avatar for ghostdog74
0
123
Member Avatar for mmiikkee12

If I have a string like this: [code] blah test asdf [/code] What kind of regex would I use to change all single newlines (like between 'blah' and 'test') to <.br> and all multiple newlines (like between 'test' and 'asdf') to a maximum of two <.br>'s? I've tried these already: …

Member Avatar for urolicious
0
158
Member Avatar for mairtin.obrian

Im using regular expressions to identify currency characters from a html string I cant identify the £ symbol from a number of sites including amazon So Im looking for the syntax to identify that symbol oRegEx = New RegEx("£[0-9]") is not working and what is the syntax to identify unicode …

0
63
Member Avatar for winbatch

I'm new to perl (and actually not even really trying to develop this skill - I inherited some code and am trying to enhance it). Basically, I want to get the text between parts of a text string. How do I get the parsed variable to contain "WHATEVER IT IS"? …

Member Avatar for winbatch
0
148
Member Avatar for bumsfeld

Decided to start my own thread rather than hijack thread "Sorting" I followed ghostdog74 advice and used module re to extract numeric strings: [php]import re data_raw = """[20] [ 35+ ] age = 40 (84) 100kg $245 """ # use regex module re to extract numeric string data_list = re.findall(r"\d+",data_raw) …

Member Avatar for bumsfeld
0
1K
Member Avatar for usagimys

Hi all, Currently i'm doing a pocket pc in Visual Studio 2005 in C#, the program is actlly to communicate with a reader using Serial Port.And i run the program using the emulator. For the code,i'm using class Serial Port to establish the connection. After doing all the settings, it …

0
66
Member Avatar for Mushy-pea

Hello everyone. I've run into a problem with regular expressions; the extraction "variables" ($1, $2, $3 etc.) are read only and scoped to the current block. If you need to do two regex extraction operations in the same block, is there a way to reset the ($1, $2, $3 etc.) …

Member Avatar for Mushy-pea
0
141
Member Avatar for pengwn

The code below gives : Data is : hello srikanth its me Data is : Data is : Data is : [code]#include <string> #include <iostream> #include <boost/regex.hpp> boost::regex e("(\\w)\\s*(\\w)\\s*(\\w)"); boost::match_results<std::string::const_iterator> what; int main() { int i; const std::string input = "hello srikanth its me"; boost::regex_match(input, what, e, boost::match_default | boost::match_partial); …

0
68
Member Avatar for pengwn

Can someone help me out code using the below to get the equivalent program as beneath: [B] boost::match_results<std::string::const_iterator> what; boost::regex_match(input, what, e, boost::match_default | boost::match_partial)) [/B][COLOR=#0000ff] [/COLOR][code]#include <iostream> #include <string> #include <boost/regex.hpp> int main() { std::string s = "who, lives:in-a, pineapple under the sea?"; boost::regex re(",|:|-|\\s+"); boost::sregex_token_iterator p(s.begin(), s.end(), re, …

0
80
Member Avatar for l2u

Hello.. Im working on my c++ application, and I have string (user input) where I would have to replace some variables/substrings in it.. For example lets say user give input: string str "this is test $some_variable some more text $random(1-5) $random(1-9)"; My program has a vector <string> of variables that …

Member Avatar for iamthwee
0
101
Member Avatar for clarkkent

Hey guys. I have a prewritten script for uploading images to my server. It already checks filesize which i need. But i also need to check the image width and height to make sure it does not go over a certain size. I am not sure how to accomplish this …

Member Avatar for trickykid
0
197
Member Avatar for digital-ether

Hi all, I was wondering if there is a way of getting the list of functions inside a class in PHP4. This would be similar to the ReflectionClass in php5. Say for example I have: [PHP]class testclass { function func1() { echo 'I am func1'; } function func2() { echo …

Member Avatar for digital-ether
0
120
Member Avatar for indienick

This post is asking ALOT, but I'm not expecting one person to leave me a hefty response, so any bits of widsom and knowledge are MUCHLY appreciated. Could someone(s) please explain to me (in detail) how to use: - Data Models (for JTree's and JTable's) - Pattern matching (java.regex.Pattern) and …

Member Avatar for indienick
0
79
Member Avatar for Phaelax

I'm trying to find all quoted strings in a given text so that I can apply proper highlighting. I've tried various regex but can't seem to get the results I want. [code] String line = "a big \"yellow\" dog! And a \"purple\" bird!"; String[] tokens = line.split("\".+\""); [/code] That cuts …

Member Avatar for Phaelax
0
97
Member Avatar for steve65

Hi all! I have been having the hardest time trying to get memory to release from an application I am developing. I know I could have written the code below without the classes but I wanted to makes sure that I understood how to pass references and not values in …

Member Avatar for alc6379
0
170
Member Avatar for red_evolve

Greetings. Here, I'd like to search for any input tags in a specific folder. I have this line:- [code]<input type([:space:]){0,1}=([:space]){0,1}("){0,1}text[B][^>|(style)]+[/B]width[/code] I'd like to ask if the bolded part [B][^>|(style)]+[/B] sounds okay. My intention is to search for any text input tags that has a width attribute, considering that the 'width' …

0
92
Member Avatar for ankit_rastogi82

Hi everybody, I want to get the start and end of all the patterns mattched in regex. I know I can get it with start() and end() fn of matched objects. But re.search() return the match object of first matching regex in the string. I want all match objects in …

Member Avatar for ankit_rastogi82
0
148
Member Avatar for dntchaseme

Hello I am trying to read an aicc ini.file and storing each section and its content into a new Object{} [section] prop1=value1 prop2=value2 prop3=value3 prop4=value4 [section2] .... .... Would someone out there knows javaScript regExp and could give me one or two hints on how to write a regex pattern? …

Member Avatar for Gargol
0
157
Member Avatar for Rete

Hi, I was wondering if anyone could help me with a problem I'm having in Java regarding Regex. All I'm trying to do (this is being dumbed down a bit) is scan a file, for specific text, and print it out. I'm trying to use regular expressions, but for some …

0
85
Member Avatar for c#dummie

i would like to know how to make my app work the way i want it... at first my app is like this> a user types anything in a textbox and as long as it's a length of 9 or 12 it'll open a form.. here's a small part from …

Member Avatar for campkev
0
218
Member Avatar for matvrix

It there a way to validate a string that >> Does not use characters like #$@ in the password. >> It must contain 1 upper case letter, 1 lower case letter, 1 number & must end in a letter. >> It must be 6-11 characters using Regular Exp ? Any …

Member Avatar for shanenin
0
294
Member Avatar for Asif_NSU

Can anyone tell me if there's any standard package for C++ to work with regular expression, or I will have to get some third-party package?

Member Avatar for Dogtree
0
147
Member Avatar for joebanks

having trouble getting this match and replace to work, im trying to just find a word and put html bold tags around it on the button click and put that text into a new jtextpane. anyone have any suggestions??? any help would be most appreciative [code] import java.awt.*; import java.awt.event.*; …

0
68

The End.