Search Results

Search found 3825 results on 153 pages for 'regex negation'.

Page 22/153 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • [C#] RegEx search for two pattern strings and cut what's between

    - by gsharp
    I'm trying to write a little SQL Helper. I have a query like this stored in a string: DECLARE @V1 INT --ignore DECLARE @V11 INT DECLARE @V12 INT --endignore DECLARE @V2 INT --ignore SELECT * FROM SampleTable INNER JOIN AnotherSampleTable ...... --endignore SELECT * From Employee ORDER BY LastName My helper method should cut everything what's between --ignore and --endignore The result string should look like: DECLARE @V1 INT DECLARE @V2 INT SELECT * From Employee ORDER BY LastName How can achieve my result with RegEx?

    Read the article

  • find all text before using regex

    - by jeff
    How can I use regex to find all text before the text "All text before this line will be included"? I have includes some sample text below for example This can include deleting, updating, or adding records to your database, which would then be reflex. All text before this line will be included You can make this a bit more sophisticated by encrypting the random number and then verifying that it is still a number when it is decrypted. Alternatively, you can pass a value and a key instead.

    Read the article

  • C# regex extracting tags

    - by SysAdmin
    Hi, Say I have a few string like Hi my name is <Name> Hi <name>, shall we go for a <Drink> Is it possible to get the tags captured through c# Regex? like <Name>, <drink> etc? I am not able to get it right..

    Read the article

  • Regex to find A and not B on a line

    - by Zach
    I'm looking for a regex to search my python program to find all lines where foo, but not bar, is passed into a method as a keyword argument. I'm playing around with lookahead and lookbehind assertions, but not having much luck. Any help? Thanks

    Read the article

  • A comprehensive regex for phone number validation

    - by Nicholas Trandem
    I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following: 1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901 I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.

    Read the article

  • Regex: Match any character (including whitespace) except a comma

    - by selecsosi
    I would like to match any character and any whitespace except comma with regex. Only matching any character except comma gives me: [^,]* but I also want to match any whitespace characters, tabs, space, newline, etc. anywhere in the string. For example, I would like to be able to match all of this up until the comma: "bla bla bla" "asdfasdfasdfasdfasdfasdf" "asdfasdfasdf", Is there a simple way to do this without knowing where the whitespace may be?

    Read the article

  • Do not match if word appears in regex

    - by David542
    I have a url, and I want it to NOT match if the word 'season' is contained in the url. Here are two examples: CONTAINS SEASON, DO NOT MATCH 'http://imdb.com/title/tt0285331/episodes?this=1&season=7&ref_=tt_eps_sn_7' DOES NOT CONTAIN SEASON, MATCH 'http://imdb.com/title/tt0285331/ Here is what I have so far, but I'm afraid the .+ will match everything until the end. What would be the correct regex to use here? r'http://imdb.com/title/tt(\d)+/.+^[season].+'

    Read the article

  • regex problem with url

    - by newBie
    i need to find regex that suitable with this.. [url]%252FShowOneUserReview-g298570-d301416-r63722677%26sl%3Dzh%26tl%3Den_US%26hl%3Den_US%26ie%3DUTF-8 its situated in is it possible for me to find only [url]...-8?

    Read the article

  • Need Help in PHP Regex

    - by amateurs
    I am studying about regex, i figured out some about matching one or more character, but i have a case, but don't know how to solve this.. For example i have: $data = "bla bla -start- blu blu blu -end- bla bla"; $pattern = "/\-start\-[\w]\-end\- /"; preg_match($pattern, $data, $matches); print_r($matches); i intend to take anything between '-start-' and '-end-', so i expect to get ' blu blu blu '. any suggestion ?

    Read the article

  • Simple line matching using Regex

    - by Joan Venge
    I have this string stream: "do=whoposted&amp;t=1934067" rel=nofollow>61</A></TD><TD class=alt2 align=middle>5,286</TD></TR><TR><TD id=td_threadstatusicon_1911046 class=alt1><IMG id=thread_statusicon_1911046 border=0 alt="" src="http://url.com/forum/images/statusicon/thread_new.gif"> </TD><TD class=alt2><IMG title=Node border=0 alt=Node src="http://url.com/forum/images/icons/new.png"></TD><TD id=td_threadtitle_1911046 class=alt1 title="http://lulzimg.com/i14/7bd11b.jpg &#10; &#10;Complete name : cool-thread...."><DIV><A id=thread_gotonew_1911046 href="http://url.com/forum/f80/cool-topic-new/"><IMG class=inlineimg title="Go to first new post" border=0 alt="Go to first new post" src="http://url.com/forum/images/buttons/firstnew.gif"></A> [MULTI] <A style="FONT-WEIGHT: bold" id=thread_title_1911046 href="http://url.com/forum/f80/cool-topic-name-1911046/">Cool Topic Name</A> </DIV><DIV class=smallfont><SPAN style="CURSOR: pointer" onclick="window.open('http://url.com/forum/members/u2031889/', '_self')">m3no</SPAN> </DIV></TD><TD class=alt2 title="Replies: 11, Views: 1,554"><DIV style="TEXT-ALIGN: right; WHITE-SPACE: nowrap" class=smallfont>Today <SPAN class=time>08:04 AM</SPAN><BR>by <A href="http://url.com/forum/members/u1131830/" rel=nofollow>karetsos</A> <A " The lines I am interested are similar to this: <A style="FONT-WEIGHT: bold" id=thread_title_1911046 href="http://url.com/forum/f80/cool-topic-name-1911046/">Cool Topic Name</A> From here all I am trying to extract are: Thread id: 1911046 (could be from either location in the string) Thread name: "Cool Topic Name" Thread link: "http://url.com/forum/f80/cool-topic-name-1911046/" Currently I use this: Regex pattern = new Regex ( "<A\\s+href=\"([^\"]*)\">([^\\x00]*?)\\s+id=thread_title_(\\S+)</A>" ); MatchCollection matches = pattern.Matches ( doc.ToString ( ) ); foreach ( Match match in matches ) { int id = Convert.ToInt32 ( match.Groups [ 1 ].Value ); string name = match.Groups [ 3 ].Value; string link = match.Groups [ 2 ].Value; ... } I would appreciate if someone can help me fix the pattern to match it. This used to work but it returns 0 matches.

    Read the article

  • Javascript regex: remove space(s) if not surrounded by a letter

    - by user326433
    I'm trying to clean some html text with javascript, there are white spaces included before and after some words (text is poorly formatted). Currently I have this regex: $("#" + target + " *").replaceText(/([\S][\u05B0-\u05C4]*)/gi, '<span class="marked">$1<\/span>'); This will capture all the non white-space characters and wrap them in a span element, but will not capture spaces between words (I need the span). How would you solve this?

    Read the article

  • How to extract text using regex?

    - by Lost_in_code
    In the HTML below: <a href="link1.php">1</a><a href="link2.php">2</a><a href="link3.php">3</a> How do I extract link1.php,link2.php,link3.php and push them into an array using regex? (There could be N number of <a> tags in the text)

    Read the article

  • regex in python, can this be improved upon?

    - by tipu
    I have this piece of code that finds words that begin with @ or #, p = re.findall(r'@\w+|#\w+', str) Now what irks me about this is repeating \w+. I am sure there is a way to do something like p = re.findall(r'(@|#)\w+', str) That will produce the same result but it doesn't, it instead returns only # and @. How can that regex be changed so that I am not repeating the \w+? This code comes close, p = re.findall(r'((@|#)\w+)', str) But it returns [('@many', '@'), ('@this', '@'), ('#tweet', '#')] (notice the extra '@', '@', and '#'.

    Read the article

  • Need a better regex for group matching

    - by user350233
    Hi, Presently I'm using two regx: ABC.*1EFG ABC.*2HIJ to retrieve Line 1 and Line 2 from a text file. Is there a better single regex, so that both the lines(L1 and L2) from below can be matched. Line 1: ABCanystring1EFGanystring Line 2: ABCanystring2HIJanystring Line 3: ABCanystring2LMNanystring . . . Line n Thanks you in advance, Su

    Read the article

  • Regex issue in rewriter config

    - by sgbinks
    I'm having an issue with bad requests from certain search parameters. An example URL: http://www.foo.com/washington/forums/search/%26 Results in a bad request. The rewriter config line looks like this: <rewrite url="^(.*)/forums/search/(.*)" to="~/Pages/Forums/Overview.aspx?Address=$1&amp;q=$2" processing="stop" /> I'm thinking it's an issue with the Regex...? Thanks in advance!

    Read the article

  • Is there YAPE::Regex::Explain alternative to python?

    - by S.Mark
    Is there perl's YAPE::Regex::Explain alternative to python? Which could do \w+=\d+|\w+='[^']+' to explanations like this NODE EXPLANATION -------------------------------------------------------------------------------- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- = '=' -------------------------------------------------------------------------------- \d+ digits (0-9) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- | OR -------------------------------------------------------------------------------- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- =' '=\'' -------------------------------------------------------------------------------- [^']+ any character except: ''' (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- ' '\''

    Read the article

  • regex help using repreated groups

    - by Chris H
    I'm trying to match rc-update -s output in python. m = re.match(r"^\s*(\w+)\s*\|{\s*(\w+)\s*}*$", " network | level1 level2 leveln ") but m is always None the hard part for me is getting the regex to match the n levels. I thought that using {}* would match the n levels, but as soon as I add the {} nothing matches. thanks.

    Read the article

  • Regex vs. string:find() for simple word boundary

    - by user576267
    Say I only need to find out whether a line read from a file contains a word from a finite set of words. One way of doing this is to use a regex like this: .*\y(good|better|best)\y.* Another way of accomplishing this is using a pseudo code like this: if ( (readLine.find("good") != string::npos) || (readLine.find("better") != string::npos) || (readLine.find("best") != string::npos) ) { // line contains a word from a finite set of words. } Which way will have better performance? (i.e. speed and CPU utilization)

    Read the article

  • How Does ont use RegEX in C++?

    - by ML
    How does one use RegEx in C++? I suppose there is Boost or PCRE.. But what if I wanted to write my own for color syntax highlighting code opened in an editor? How would I do this from scratch?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >