109 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Tom_45

I am trying to extract three values from the td tags in an html downloaded file. <tr align="right"><td>236</td><td>Roy</td><td>Allyson</td> <tr align="right"><td>237</td><td>Marvin</td><td>Pamela</td> <tr align="right"><td>238</td><td>Micah</td><td>Kristine</td> <tr align="right"><td>239</td><td>Collin</td><td>Raquel</td> I am using the pattern match = re.findall(r'<td.?>([\d+])([.?])*<\/td>', file) The file is created with a read() statement. The output should look like (236, "Roy", "Allyson") (237, …

Member Avatar for Tom_45
1
90
Member Avatar for Dani

I'm really bad with regex. For the purposes of URI rewriting, I'm trying to figure out how to match a word one or more times in a string. For example, I want to do something like: string/string/string/foo/bar => foo/bar string/string/bazbat => bazbat Currently I have: ^string/(.*)$ => $1 and that …

Member Avatar for Reverend Jim
0
101
Member Avatar for bprosic

Hi, how can I use regex or string replace to add missing "p" tags to sentences without tags. I tried matching* and splitting first the whole string matching "h" and "pre" tags but dont know how to merge it. `*let regexRule = /<pre>(.|\n|\r\n)[\s\S]*?<\/pre>/g;` Example - input let someVariable = "Basket …

Member Avatar for Diafol_2
1
1K
Member Avatar for EvolutionFallen

Hello, I'm hoping for some help with a regex that has me stumped. My skill with regex is rather rudimentary. To start, here are a couple of example URLs, and whether I want to match them or not: collection/col1 // MATCH collection/col2 // FAIL collection/col1/products/pro1 // FAIL My criteria: * …

Member Avatar for xrjf
0
2K
Member Avatar for Aeonix

I've been Googling this one, and I've come across solutions, but they don't seem to work for me. The code is as follows: <?php $name1 = "Jack Random"; // true $name2 = "JackRandom"; // true $name3 = "Jack;Random"; // false $name4 = "JackRand;om"; // false // Accept only A-Z, a-z, …

Member Avatar for pritaeas
0
357
Member Avatar for AssertNull

I've always been bad with regular expressions syntax. I am converting text into Bezier curves, polygons, etc. Part of that is identifying points in the form `(x,y)` where x and y are coordinates in a graph. I am extracting x and y as doubles and creating Point objects with those …

Member Avatar for AssertNull
0
359
Member Avatar for Stefce

Hello guys i need to get all currencies in the world is there anyone who knows where to get them in a file so i can import it in my website or someone who can help me to solve with regular expression here is the [WEBSITE](http://www.xe.com/currencytables/?from=INR) where i have fund …

Member Avatar for cereal
0
153
Member Avatar for arindam31

Here is a weird regular expression for emails . We can have various kind of email addresses [email]string1@somemail.com[/email] [email]string1@somemail.co.in[/email] [email]string1.string2@somemail.com[/email] [email]string1.string2@somemail.co.in[/email] The following regular expression can find any of the mails above email2="santa.banta@gmail.co.in" email1="arindam31@yahoo.co.in'" email="bogusemail123@sillymail.com" email3="santa.banta.manta@gmail.co.in" email4="santa.banta.manta@gmail.co.in.xv.fg.gh" email5="abc.dcf@ghj.org" email6="santa.banta.manta@gmail.co.in.org" [CODE]re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email) >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email2) >>> x.group() 'santa.banta@gmail.co.in' >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email1) >>> x.group() 'arindam31@yahoo.co.in' …

Member Avatar for Syed Sulaiman
3
10K
Member Avatar for Papa_Don

Group, I need to insert an "If/Then" statement that will require the command to check the string for multiple variables. In other words it needs to say something like this: If Microsoft.VisualBasic.Mid(txtLine, 18, 1) = "C" or "T" or "G" or "W" Then Go do something End If After doing …

Member Avatar for Reverend Jim
0
248
Member Avatar for steven.rose.94

''' in Python 3.4 Attempting to parse and print one line (actually a number)from the downloaded code from yahoo sourecode using regex to pull the number that is located at the (.*?). I've tried everything I can think of to get this to work - I expect the problem is …

Member Avatar for steven.rose.94
0
349
Member Avatar for brittney_2

I want to know if I would be able to replace different words all in one regex expression. For example if I wanted to replace the name John with Joe and Smith with Doe. Would I be able to do that with one expression? Here is a code that I …

Member Avatar for ~s.o.s~
0
731
Member Avatar for fedaa91

Hi i tried this regular expression `^(?:\00|9)[. ()-]*(?:\d[. ()-]*){8,14}$ `to enter a phone number in a text field ,but it didnt work like i wanted . what i want the rule to be is if the phone number starts with 9 then the length would be 8 digits, but if …

Member Avatar for fedaa91
0
338
Member Avatar for nouth
Member Avatar for nouth
0
155
Member Avatar for nouth

how to `.replace()` the `'error'`? only use `a` and `b` var str = 'bla bla anything error anything bla bla'; var a = 'anything', b = a; im not good with regular expressions so im asking for how to do this with variables so i can set them up all …

Member Avatar for diafol
0
6K
Member Avatar for jazzermonty

Hi guys I've written a very simple program that reads in some files, does some cleanup on the data and then creates a sql statement to insert the data into a table. Now I have 125 of these fies of varying sizes and on some (not all) of the files …

Member Avatar for jazzermonty
0
317
Member Avatar for Kristian_2

I have solved it... Shame... -------------------------------- I have problem with this code: cin >> str; smatch m; regex e("([[:w:]]+)@([[:w:]]+)\.com"); //<- Here was the error (it was regex e("([[:w:]+)@([[:w:]]+)\.com");) silly me :(( bool found = regex_search(str, m, e); cout << "m.size() " << m.size() << endl; for (int n = 0; …

0
147
Member Avatar for Varunkrishna

Hi all I have a textarea I would like to validate the same for empty spaces and on no input. Please find my jsfiddle [here](http://jsfiddle.net/Varun_Krishna/jJh8q/). How do I validate for empty spaces in the text area? what am I missing in my fiddle? Thanks Varun Krishna. P

Member Avatar for Varunkrishna
0
2K
Member Avatar for deadsolo

Hello Everyone, As the title implies I need help extracting a name out of a string, my knolwedge of regular expressions is pretty limited. The strings I will be working with will look like this: 12345 Aragon Denvil L. 123-1234 A123456 AragonD AragonAD@fake.mail.us 1000001234 ABC-ABC 123ABCD123 ABCD 1234 A1234 ABC12345A1 …

Member Avatar for deadsolo
0
611
Member Avatar for srinu_1

hi, **please help me to solve the error for:** **text1.txt:** line1 <data> line2 <items> line3 <match name="item1" rhs="domain.com"></match> line4 <match name="item2" rhs="domainn.com"></match> line5 <match name="item2" rhs="1010data.com"></match> line6 </items> line7 </data> **text2.txt:** line1 djshjsdf line2 sdfngjfg check domain.com,domain.com,1010data.com in text2.com, if not there print domain.com,domain.com,1010data.com in to the 3rd text file(text3.txt) …

Member Avatar for snippsat
0
371
Member Avatar for abhijit_2
Member Avatar for deceptikon
0
118
Member Avatar for suncica2222

I need regex for parsing phpbb forum style quote tags, general case with preserved items order. Like quoted, unquoted, quoted, quoted, quoted... etc... Also there are NOT NESTED quotes. I'll explain on example. some unquoted text11 [quote="person1"]some quoted text11[/quote] [quote="person2"]some quoted text22[/quote] [quote="person3"]some quoted text33[/quote] some unquoted text22 ... [quote="person4"]some …

Member Avatar for pixelsoul
0
344
Member Avatar for trishtren

Hello, im currently working on a program to split a string based on symbols only, i need to seperate the string around the symbols whilst keeping the symbols as well eg. test_String_123_^; would result in an array containing : [test] [_] [String] [_] [123] [_] [^] However although i have …

Member Avatar for masijade
0
273
Member Avatar for Taruna_1

Hi, I want to replace all the character in my string with 'aaaa' as many number of times as there are occurence of the character. For eg. if my string is "cat", output should be "aaa" and if its "hello" output should be "aaaaa". As of now, I am using …

Member Avatar for vegaseat
0
316
Member Avatar for pritaeas

For all people having issues building the right regex: I just came across this nice little helper, which allows you to describe what you want using chained methods. https://github.com/jehna/VerbalExpressions

0
120
Member Avatar for asprin

This is really a spoon feeding request. I'm in the process of learning regex, which will take time to perfect, but as of now I'm in immediate need of help to work on regex expression. Suppose I've a string like $str = "asggasdg46%dgeoweg5.3%sdgeoge4%kge"; In the above string, I need to …

Member Avatar for asprin
0
185
Member Avatar for Jahliah

I'm trying to get the time from input of html txt_URL but the array returns nothing. Not sure where I went wrong. Any help is appreciated. Thanks! **input:** Deleting 11 files. Details: Time Deleted = 01:16:30, Time Left = 00:00:00, **output:** 01:16:30 string before = txt_URL.Value; string after = Regex.Replace(before, …

Member Avatar for Jahliah
0
324
Member Avatar for Jorox03

I am trying to write some code to regex search against wide strings. The problem I am having is that the regex operations ( `regex_search` in particular ) does not take in wide arguements. Here is the snippet I am having trouble with: Function Header: void scan_filesystem( wpath const& f, …

Member Avatar for Jorox03
0
6K
Member Avatar for LastMitch

Hi I'm trying figure why I'm getting this error **Undefined offset: 1**. I'm practicing with **list()** function and with a **explode()** function. When I ran the code it kept mention this error: Undefined offset: 1 The line is this: list($bagsize, $candyprice)=explode("#", $_GET["size"]); The list is not an array. It's on …

Member Avatar for LastMitch
0
27K
Member Avatar for professor123

hie i have a php form which will require a user to enter an ID Number in this particular form e.g. 34 1297336 Z 42 how to i create an easy and neat validation for that field. thanks any help will be appreciated!

Member Avatar for professor123
0
159
Member Avatar for deadsolo

Hi there everyone, I am having some difficulties getting a regular expression to work. I have a line of text with 5 numbers.I want to ignore the first number, and grab the other 4 numbers. Here is what the text I am dealing with looks like. 1681 12.33754513 7.066246057 6.079261254 …

Member Avatar for deadsolo
0
286

The End.