Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 11/269 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Modify a reference numbered group to match against

    - by StuperUser
    I want to match YYYY-YY for sequential years. I at moment I'm trying to match where all the second YY is the 3rd and 4th characters in YYYY with 1 added to it. So far I've got {19|20}(\d{2})-(\d{2}), but not sure how to use ? with reference to (1) or whether I'm going about this the right way and finding out the inevitable "unknown unknowns" (like YY99) with this approach? Edit: Matches: 2010-11,2011-12,2029-30 Not matches: 2010-12, 2010-09,2011-2,2011-2012

    Read the article

  • .NET Entire line match.

    - by user93422
    I need to check if entire given input matches given pattern. But wrapping a pattern in ^/$ feels like a hack. Is there a shortcut for: var match = Regex.Match(myInput, "^" + myPattern + "$"); ?

    Read the article

  • Regular Expression to Match YouTube Watch URL

    - by dododedodonl
    Hi, I've got this regex (I'm not good at it) /http://www.youtube.com/watch?v=[a-zA-Z0-9_]/i it has to match any youtube watch url (because youtube always redirects to that domain)... It should match http://www.youtube.com/watch?v=iMXCqgWjpL8 but it doesn't. Can someone help me? Regard, dodo

    Read the article

  • Regex: Match words in sentence PHP

    - by Granit Luzhnica
    Hi, I have an array with words like $arr = arra("go", "walk", ...) I would like to replace these words with links f they are matched in sentences. But it should be only if they match exactly (for example "walk" should match "Walk" or "walk!" but not also "walking") And the replacement should be a simple link like: < a href='#walk' walk< /a Anybody Any idea?

    Read the article

  • How to replace only part of the match with python re.sub

    - by Arty
    I need to match two cases by one reg expression and do replacement 'long.file.name.jpg' - 'long.file.name_suff.jpg' 'long.file.name_a.jpg' - 'long.file.name_suff.jpg' I'm trying to do the following re.sub('(\_a)?\.[^\.]*$' , '_suff.',"long.file.name.jpg") But this is cut the extension '.jpg' and I'm getting long.file.name_suff. instead of long.file.name_suff.jpg I understand that this is because of [^.]*$ part, but I can't exclude it, because I have to find last occurance of '_a' to replace or last '.' Is there a way to replace only part of the match?

    Read the article

  • List files that don't match a string in bash

    - by Javier
    Dear all, I'm a newbie in bash and I would like to pass as parameter to a python function all files in a directory that don't match a given pattern. sth. like: $myscripts/myprog.py $myfiles/!(bonjovi) The above example should retrieve all files that don't match to "bonjovi". Best wishes

    Read the article

  • Match multiple terms within <body> tags

    - by Jeepstone
    I've want to match any occurrence of a search term (or list of search terms) within the tags of a document. My current solution uses preg (within a Joomla plugin) $pattern = '/matchthisterm/i'; $article->text = preg_replace($pattern,"<span class=\"highlight\">\\0</span>",$article->text); But this replaces everything within the HTML of the document so I need to match the tags first. Is this even the best way to achieve this?

    Read the article

  • sed as grep + ignore # and match

    - by yael
    I have the following file example more somefile param=a b c d e f g z x w # param=a b c d e f g z x w I need to create with sed the following (should be one line if possible): Ignore # char in the beginning of line Match first the param string Second match the "a b c d e f g z x w" (like grep -w) and give exit status if success Something like .... sed "/^ *#/b; /\<param\>/" ....

    Read the article

  • How to check if a string has earlier been set using iabbr (full match)

    - by Sumit
    I am trying to check if a lhs is already abbreviated in vim. mapcheck, however, seems to have a problem. For example, iabbr swt switch echo mapcheck('sw','i',1) returns "switch" even when "switch" defined for "swt". mapargs seem to return a string even if there is a partial match with the lhs. Is there a way to find if an abbreviation has been defined for the "exact" match, i.e., the above mapcheck returning a "" instead.

    Read the article

  • nginx reload failing: `object version does not match bootstrap parameter`

    - by Jean Jordaan
    I added a server stanza to my virtual.conf, and now nginx seems to have a problem reloading the config. At this point I don't know what exactly is going wrong or how to debug better. Any help would be most appreciated. The config test succeeds: root@server:~# service nginx configtest nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful I'm tailing the logfile. Upon reload, the following error is logged. As far as I can see, the new config is not used. root@server:~# service nginx reload Reloading nginx: [ OK ] root@server:~# ==> /var/log/nginx/error.log <== nginx object version 0.8.54 does not match bootstrap parameter 1.0.15 at /usr/lib64/perl5/XSLoader.pm line 94. Compilation failed in require. BEGIN failed--compilation aborted. 2012/10/18 12:31:07 [alert] 9620#0: perl_parse() failed: 2 This is the version of nginx I'm running: root@server:~# yum info nginx Loaded plugins: fastestmirror, presto Loading mirror speeds from cached hostfile * base: ftp.udc.es * epel: mirror.nl.leaseweb.net * extras: ftp.udc.es * updates: ftp.cica.es Installed Packages Name : nginx Arch : x86_64 Version : 1.0.15 Release : 2.el6 [...] Server OS: CentOS release 6.3 (Final)

    Read the article

  • Wildcard DNS entry to match lang subdomain

    - by Adam Benayoun
    Hey, We have a website www.example.com pointing to x.x.x.1 and a system with multiples minisites all having subdomains.examples.com pointing to x.x.x.2 Basically what we have in place is a wildcard DNS entry who could basically match any possible subdomain, once reaching x.x.x.2, the apache vhost would intercept and basically redirect it to a php script who in turn would know what minisites to serve. On www.example.com however, we server contents which are translates in several languages, until few weeks ago you could switch languages by clicking on a flag and you'd be served with the translated content. The only problem is that the URL wouldn't change and SEO wise this isn't the best solution. Now I cannot change the way subdomain are handled (being redirected to x.x.x.2) since we have hundreds, if not thousands of minisites live. I have to come up with a solution to have language.example.com redirecting to x.x.x.1 and then a rewrite rule who would basically rewrite the fake subdomain into a URL in order to pass the parameter of the language to example.com On solution is to list all possible language as DNS entries right before the wildcard DNS entry. The other solution which I am almost sure is not feasible is to have some kind of regex in a DNS entry matching all subdomain with 2 letters ( en|es|fr|cn|cl etc... ) Any ideas?

    Read the article

  • Make eix available version match emerge

    - by Ryaner
    We have out Gentoo hosts using a binhost with EMERGE_DEFAULT_OPTS="--getbinpkgonly --usepkgonly" in the make.conf file so that the host only pulled down the binary hosts. All works well from that side. I use eix to check on software versions for upgrades but have hit a problem where eix will see an available version ahead of what is available on the binserver. Using glibc as an example ietpl [VE] / # emerge -s glibc Searching... [ Results for search key : glibc ] [ Applications found : 1 ] * sys-libs/glibc Latest version available: 2.14.1-r3 Latest version installed: 2.14.1-r3 Homepage: Description: GNU libc6 (also called glibc2) C library License: LGPL-2 Then eix reports a higher version available ietpl [VE] / # export LASTVERSION='{last}<version>{}' ietpl [VE] / # /usr/bin/eix --nocolor --format '<category> <name> [<installedversions:LASTVERSION>] [<bestversion:LASTVERSION>] \n' --exact --category-name sys-libs/glibc sys-libs glibc [2.14.1-r3] [2.15-r2] What I'm after is for eix to report the latest version available as 2.14.1-r3 like emerge. I've a feeling this is possible since without any formatting, eix returns Available versions: (2.2) ~2.9_p20081201-r3!s 2.10.1-r1!s 2.11.3!s ~2.12.1-r3!s 2.12.2!s{tbz2} ~2.13-r2!s 2.13-r4!s ~2.14!s ~2.14.1-r2!s 2.14.1-r3!s{tbz2} ~2.15-r1!s 2.15-r2!s ~2.15-r3!s **2.16.0!s **9999!s correctly tagging the latest unmasked binary package with {tbz2} I would have thought that the binary flag would do it, but that returns no matches --binary Match packages with *.tbz2 files.

    Read the article

  • Excel Matching problem with logic expression

    - by abelenky
    I have a block of data that represents the steps in a process and the possible errors: ProcessStep Status FeesPaid OK FormRecvd OK RoleAssigned OK CheckedIn Not Checked In. ReadyToStart Not Ready for Start I want to find the first Status that is not "OK". I have attempted this: =Match("<>""OK""", StatusRange, 0) which is supposed to return the index of the first element in the range that is NOT-EQUAL (<) to "OK" But this doesn't work, instead returning #N/A. I expect it to return 4 (index #4, in a 1-based index, representing that CheckedIn is the first non-OK element) Any ideas how to do this?

    Read the article

  • Java: Match tokens between two strings and return the number of matched tokens

    - by Cryssie
    Need some help to find the number of matched tokens between two strings. I have a list of string stored in ArrayList (example given below): Line 0 : WRB VBD NN VB IN CC RB VBP NNP Line 1 : WDT NNS VBD DT NN NNP NNP Line 2 : WRB MD PRP VB DT NN IN NNS POS JJ NNS Line 3 : WDT NN VBZ DT NN IN DT JJ NN IN DT NNP Line 4 : WP VBZ DT JJ NN IN NN Here, you can see each string consists of a bunch of tokens separated by spaces. So, there's three things I need to work with.. Compare the first token (WRB) in Line 0 to the tokens in Line 1 to see if they match. Move on to the next tokens in Line 0 until a match is found. If there's a match, mark the matched tokens in Line 1 so that it will not be matched again. Return the number of matched tokens between Line 0 and Line 1. Return the distance of the matched tokens. Example: token NN is found on position 3 on line 0 and position 5 on Line 1. Distance = |3-5| = 2 I've tried using split string and store it to String[] but String[] is fixed and doesn't allow shrinking or adding of new elements. Tried Pattern Matcher but with disasterous results. Tried a few other methods but there's some problems with my nested for loops..(will post part of my coding if it will help). Any advice or pointers on how to solve this problem this would be very much appreciated. Thank you very much.

    Read the article

  • XSL - How to match consecutive comma-separated tags

    - by PocketLogic
    I'm trying to match a series of xml tags that are comma separated, and to then apply an xslt transformation on the whole group of nodes plus text. For example, given the following partial XML: <p>Some text here <xref id="1">1</xref>, <xref id="2">2</xref>, <xref id="3">3</xref>. </p> I would like to end up with: <p>Some text here <sup>1,2,3</sup>.</p> A much messier alternate would also be acceptable at this point: <p>Some text here <sup>1</sup><sup>,</sup><sup>2</sup><sup>,</sup><sup>3</sup>.</p> I have the transformation to go from a single xref to a sup: <xsl:template match="xref""> <sup><xsl:apply-templates/></sup> </xsl:template> But I'm at a loss as to how to match a group of nodes separated by commas. Thanks.

    Read the article

  • regex match css class name from single string containing multiple classes

    - by effectica
    I have a long string that contains multiple css classes. With regex I would like to match every class name as I then need to replace these class names like so: <span>CLASSNAME</span> I have tried for hours to come up with a solution and I think I am close however for certain class names I am not able to exclude closing curly brackets from the match. Here is a sample string I have been carrying out testing on: #main .items-Outer p{ font-family:Verdana; color: #000000; font-size: 50px; font-weight: bold; }#footer .footer-inner p.intro{ font-family:Arial; color: #444444; font-size: 30; font-weight: normal; }.genericTxt{ font-family:Courier; color: #444444; font-size: 30; font-weight: normal; } And here is the the regex I came up with so far: ((^(?:.+?)(?:[^{]*))|((?:\})(?:.+?)(?:[^{]*))) Please look at the screenshot I am attaching as it will show more clearly the matches I get. My problem is that I would obviously like to exclude curly brackets from any match.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >