269 Topics

Member Avatar for
Member Avatar for lilym

I am new to Regex... I need to split by "|&|" -- three characters in that exact order. For example, **"abc|&|e&f**" should return *"abc"* and *"e&f"*. I tried string.split("|&|") , but it return all single characters.

Member Avatar for NormR1
0
53
Member Avatar for achava

Suppose I need to have a regex expression (using Perl regex) that, say, matches a*b\q as simple text and does not interpret a* as any number of a's. I know it is simple here, but I need it to work for ANY string of characters.

Member Avatar for 2teez
0
299
Member Avatar for andarivaadu1

Hi, I don't have any idea about regular expression. Can some on please suggest a good website for regular expression Tutorial. Also 1.Can some one please help me to generate a regular expression meeting all these requirements * A strings minmum length must be 3 charcters, and maximum length must …

Member Avatar for seslie
0
152
Member Avatar for dartiss

Morning, I'm attempting to perform a preg_match against a regular expression to identify whether it's a YouTube video or not. I've got, I'll admit, the regular expression from elsewhere... \s*(https?:\/\/www.youtube(?:-nocookie)?.com\/(?:v|embed)\/([a-zA-Z0-9-]+)).* This appears to work fine. However, I'm getting the following error when I attempt the preg_match... WARNING: [filename].php:[line] - preg_match() …

Member Avatar for dartiss
0
193
Member Avatar for poojavb

Hello Friends... I need help on regular expressions.... I tried the following way but it did not work for me....please help me to create a regular expression... ^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(^[a-zA-Z0-9@\$=!:.#%]+$) My requirement is -> Min 8 to 15 characters - this I will do with the length validation or by including in …

Member Avatar for poojavb
0
245
Member Avatar for notconfirmed

Hello there, I'm a newbie in regex in c#, and I have a problem in parsing the html tag using regex in the <span> tag. here the html file that i want to get the value. <li><span>Date of birth</span>December 16, 2000 (Age: 12)</li> i want to get the December 16, …

Member Avatar for Mitja Bonca
0
3K
Member Avatar for apanimesh061

What should be the regular expression for thid code ??? `<span style="text-align:justify;">Stepping out of the Shadows:M6 Once touched... Marisa Somerville has changed. Now a confi dent, groomed, successful businesswoman, in some ways she's nothing like the scared wife of an abusive husband that Rafe Peveril survived a plane crash with …

Member Avatar for apanimesh061
0
294
Member Avatar for Dani

This has been frustrating me for about 20 minutes already and I don't want to spend much more time on it, so any help would be much appreciated. The editor that we use which syntax highlights Markdown text has has bug in which it highlights text as code when it …

Member Avatar for Dani
0
689
Member Avatar for mbhanley

Need help with code i am trying to acheive upload of videos but when they are uploaded the file names need to be changed to have hyphens in replace of white space and still keep the exstensions. its proving difficult because once uploaded ffmpeg needs to read the output as …

Member Avatar for mbhanley
0
459
Member Avatar for bishisht

Hello there below is the easy way to get the email addresses extracted from any file. import os import re import sys def grab_email(file): """Try and grab all emails addresses found within a given file.""" email_pattern = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b',re.IGNORECASE) found = set() if os.path.isfile(file): for line in open(file, 'r'): found.update(email_pattern.findall(line)) for …

Member Avatar for TrustyTony
1
300
Member Avatar for Usmaan

I am using: underscoredWord = Regex.Replace(word, "[^" + correctLetters + "]", " _"); for my Hangman game. It basically chops the word up and replaces all the text with an underscore. This works fine if the guessing word is only "one word". So the word: "Building" will get converted to: …

Member Avatar for thines01
0
579
Member Avatar for Donnovan

Hallo, How can i use Regex to match names in different files. e.g. i have 3 files with names. i need to link the matching names in the different file. any ideas.

Member Avatar for thines01
0
106
Member Avatar for Clarkeez

Hello I'm not sure how this is possible but I want to enter a wildcard(?) into a php variable.. like this, <?php if($_SERVER['HTTP_HOST'] == '*.domain.com') { //do something } ?> Notice the * I basically need it to match if its any subdomain of domain.com Possible?

Member Avatar for Biiim
0
355
Member Avatar for freddyk

Hi everyone. I'm trying to convert an assembly code to its corresponding regular expression. I'm trying to match program patterns to discover anomalies. Being a novice in assembly language, i thought i would try to first convert a simple addition program to its corresponding expression before moving onto other code. …

Member Avatar for freddyk
0
680
Member Avatar for dalip_007

well Guys i am not sure if what i want is atleast possible or not. what i want is to write a script in php, which will crawl through all my hard drive for all files and folders irrespctive of the file type and pick the emails address up and …

Member Avatar for pritaeas
0
200
Member Avatar for Dani

Soooo ... quick question :) I need to do some HTML parsing with regex :) I currently use `$output = preg_replace('/>\s+</', "> <", $output)` to strip whitespace between any two HTML tags. What can I do to strip whitespace only between paragraph tags. For example, only between `</p>` and `<p>` …

Member Avatar for Dani
0
413
Member Avatar for saad749

I have this Regular Expression in C#: Regex myRegex = new Regex(@"^[a-zA-Z]{1}\s(! | && | \|\| | -> | <->){1}\s[a-zA-Z]{1}$"); if (myRegex.IsMatch(expression)) { validated = true; } else { validated = false; } and I would like to match the following types of Strings: A && B A -> B …

Member Avatar for saad749
0
195
Member Avatar for SCass2010

Hi everyone, Just wondering if anyone could help. At the minute I need to check a command line for the parameter "--date=something", I've been using the re module with python like this cmd = "python myapp.py --name=stephen --date=20120323 --test=testthis" found = re.split (r"--date.*", cmd) print found but this prints the …

Member Avatar for TrustyTony
0
180
Member Avatar for srinidelite

var RE_SSN = /^[0-9]{3}[\- ]?[0-9]{2}[\- ]?[0-9]{4}$/; hello , i would like to know what is the meaning behind in these ^ ,[\- ],$ symbols??? and i would able to follow that the script logically verifying the format of text being entered!! i.e NNN-NN-NNNN... Thanks in Advance .. Srini.

Member Avatar for srinidelite
0
105
Member Avatar for erogol

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?

Member Avatar for d5e5
0
140
Member Avatar for erogol

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?

Member Avatar for replic
0
81
Member Avatar for termin8tor

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 …

0
91
Member Avatar for Aamit

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.

Member Avatar for pritaeas
0
171
Member Avatar for baig772

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] ?

Member Avatar for baig772
0
150
Member Avatar for hamidvosugh

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 …

Member Avatar for Gribouillis
0
158
Member Avatar for andy106

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 …

Member Avatar for rubberman
0
183
Member Avatar for gamebits

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 = …

0
88
Member Avatar for desup

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 …

Member Avatar for desup
0
134
Member Avatar for Cupidvogel

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 …

Member Avatar for d5e5
0
278
Member Avatar for Melow

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 " …

Member Avatar for Melow
0
187

The End.