Reg expression question

Why does when parsing the string
"(*&^Max's)()(#" using the regex
"[a-zA-z]+(.*)[a-zA-z]+"the result is "^Max's" instead of "Max's" I understand that ^ is a regex special character, but do not see why it pops up.

@OP. You get that output because you have an error in
your pattern, you should use a-zA-Z and not
a-zA-z
That is, the pattern should be:
"[a-zA-Z]+(.*)[a-zA-Z]+"Kajor "\\p{Alpha}+(.*)\\p{Alpha}+"But I'm a little suspicious of that ".*" int middle. I assume since you're searching for alphas on both sides of it, that for the .* you want "anything except alpha." If that's the case, it becomes "\\p{Alpha}+(\\P{Alpha}*)\\p{Alpha}+"

Similar Messages

  • Validate through Reg Expression

    Hi,
    I have following requirement to be achieved through reg expressions.
    Need to write a boolean method which takes a String parameter that should satisfy following conditions.
    o 20 character length string.
    o First 9 characters will be a number
    o Next 2 characters will be alphabets
    o Next 2 characters will be a number.(1 to 31 or 99)
    o Next 1 character will be an alphabet
    o Last 6 characters will be a number.
    JDev 11.1.1.6.0

    Hi,
    Hope following links are useful
    https://blogs.oracle.com/shay/entry/regular_expression_validation
    http://www.vogella.com/articles/JavaRegularExpressions/article.html

  • CFINPUT Reg Expression Validation Pattern Help

    I've got a form with a non-required field that needs to meet
    some validation requirements (Numbers, Letters, 'space character'
    or 'blank, empty string' only) if the user chooses to fill it
    out...
    I'm using CFINPUT tag with the following settings, does my
    Reg Expression pattern look OK?
    REQUIRED="No"
    VALIDATE="regular_expression"
    PATTERN="^[a-zA-Z *]{1,40}$"
    MAXLENGTH="40"
    Thanks for any help. I'm v. new to regular expressions (10
    hrs education at Google Univ.)
    Sincerely,
    Paul Cross

    I think you want something more like this:
    ^[a-zA-Z0-9 ]{0,40}$

  • Reg expression help

    Can/will you help me make a regular expression for these characters? I want to replace eveyone occurance in a string contianing these chars
    \/:*"<>|
    with
    right now I am doing a string.replaceAll(...) on each char but I was wanting to combine that to one reg expression. What cha got? I am doing this b/c I am generating file names and those are not valid chars allowed in file names.
    Thanks
    Doopterus

      String regex = "[*<>/'\"\\\\]";In a character class (i.e., between the square brackets), "|" has no special meaning.

  • Resgular Expression question

    Hi guys. I am a java programmer for a couple of years now but I could never learn regular expressions in this or any other language. My problem is that I want to use String's replaceAll method to replace all HTML structures from a string. Actually, I want to remove all <*>, ie all character between the angular brackets (together with teh brackets of course). Does anyone have any idea how this is done with regular expressions?
    replaceAll method is defined as follows:
    String      replaceAll(String regex, String replacement)
    Replaces each substring of this string that matches the given regular expression with the given replacement.
    Thanks in advance

    Hi,
    public class Test {
         public static void main(String[] args) {
              String test = "<img src=\"blah blah\">hello</img> and so on <br>.";
              System.out.println(test.replaceAll("<[^>]*>", ""));
    }Kaj
    Ps.
    Native methods is not the correct forum for this kind of questions. You should have posted in Java programming.

  • 10G EXPRESS QUESTIONS

    I want to download and start using the free express edition of the db. Before doing so, I have several questions before getting started:
    1) I plan on downloading to, and using the db on, only one system. Which version do I need??? Do I need the server version, client version, or do I need both???
    2) I would prefer to download and use the db from a laptop versus a desktop. Any issues with that??? Of course, the laptop would be sized correctly.
    3) I would prefer to use the db on a Mac but see there is not a version for the Mac OS. Which is the better OS for this db, Windows or Linux???
    Thanks in advance for the help.
    JG

    I want to download and start using the free express
    edition of the db. Before doing so, I have several
    questions before getting started:
    1) I plan on downloading to, and using the db on,
    only one system. Which version do I need??? Do I
    need the server version, client version, or do I need
    both???The 'server' is the database. The 'client' is the software needed to get to the server (get to the database) across the network.
    You need the server at the least.
    If you want to access the database from other computers using something other than a browser, you need the 'client'.
    2) I would prefer to download and use the db from a
    laptop versus a desktop. Any issues with that??? Of
    course, the laptop would be sized correctly.I run Oracle XE on a laptop. 1GB RAM, 40GB disk, P4-2.2GHz laptop. I'm pretty happy.
    3) I would prefer to use the db on a Mac but see
    there is not a version for the Mac OS. Which is the
    better OS for this db, Windows or Linux???
    Which car is better - a Ford or a Chrysler?
    It really comes down to personal preference. The differences between Windows and Linux are not really all that great any more.
    And just like cars - just don't forget that eith has to be maintained. Regularly.
    Message was edited by:
    Hans Forbrich
    PS: I use Linux. But mainly because I've been using computers since the late 1960s and hate the hype around GUI.

  • Silly Base Station / Express question

    Hi. Silly Question... Is my Airport Express my Base Station? I've only got the Express and I can connect to the internet just fine. Or does Base Station refer specifically to the round flying-saucer looking thingy? That would explain why I can't see it listed in Airport Setup utility under the Base Station columns. I'm trying to make sure my Express is set up correctly to print, but I didn't specify having a printer when I set up the Wireless Network. Sorry about this, but it might just solve my problem. Thanks in advance. I promise I'll learn quickly.
    M
    Ibook   Mac OS X (10.4.2)  

    I'm not sure if it's a defective AX... just from my personal experience I had similar issues with 3 I needed to return.
    If I recall correctly, you only have 2 choices... either the AX acts as a base station or it's a client of another base station. I suppose it might be possible you had it set as a client and it's just picking up an open access point nearby.
    I would just try restarting the AX and your computer. If that doesn't work, maybe you could try a soft -> hard -> factory reset, in that order.
    Do you have an Apple Store nearby? If so, and none of the above works, you can always take it to the genius bar and they may be able to help.
    Curt

  • EL Expression questions

    Hi, I have two questions on the El Expression in the JSF:
    1)Can anyone link a El Expression (for JSF) references page?
    2)Can I use a El Expression (like the ternary selection operator) in action attributes or in actionListener or valueListener attributes?

    Link is here (for Tomcat EL - Classes and interfaces for the JSP 2.0 Expression Language API.)
    http://tomcat.apache.org/tomcat-5.5-doc/jspapi/javax/servlet/jsp/el/package-summary.html
    or
    http://java.sun.com/products/jsp/2.1/docs/jsp-2_1-pfd2/javax/servlet/jsp/el/package-summary.html
    for JSF 1.2
    BTW: Its not JSF EL but JSP specification
    EL can star from $ or #: $ is page context # is faces context, sometimes You can use $ for JSF tags, but not always, to implement such an operator check this: http://www.oracle.com/technology/pub/articles/cioroianu_jspapi.html
    But, for now, there is no way to have such an operator out of the box, You just cant't put this kind of logic to view layer

  • OSB Express questions

    Hi,
    I'm planning to use Oracle Secure Backup Express (OSB-XE) , described as license free with some limitations.
    i have some questions :
    1./ Does this free version allow me to use a Single Drive tape library (SAS ) attached to a server?
    2./ Would be possible to perform backup of all servers through the network from the central server that has the library attached?
    Our configuration is based in 3 servers with linux and one of the servers will manage the attached single drive library (or autoloader) , but we would like to know if OSB Express will be enabled to perform backup of more servers than the one where the software and drive resides.
    Also, has anyone experienced with this software and version? does anybody have any comments on functionality or usability?
    kind regards.

    Based on your environment, you would need to license OSB. The OSB-XE version supports backup of ONE host to a single attached tape drive. The licensing guide describes the differences between OSB and OSB-XE:
    http://download.oracle.com/docs/cd/E14812_01/doc/doc.103/e12836/toc.htm
    Donna

  • Regular Expressions - Questions to SME

    Ralph Benzinger presented an online meetup on the topic of Regular Expressions.  The presentation (slides only) can be found <a href="http://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/866072ca-0b01-0010-54b1-9c02a45ba8aa">here</a>
    Unfortunately the recording is not going to be available, but Ralph has been generous enough to agree to answer questions posted to this sticky thread.
    cheers,
    Marilyn

    Hello Peter,
    You're welcome!
    Alas, I was unable to locate the regex documentation on help.sap.com either.  In fact, I'm not even sure it has already been updated for 2004s.  I recommend that you use the online documentation within the system, e.g., from transactions SE38 or SE80.  Do an index search for "regex", and you'll be directed to REGEX, FIND and REGEX, REPLACE, both of which have extensive subsections on regexes.
    The class cx_sy_regex is an exception class that is thrown by FIND, REPLACE and cl_abap_regex in case of an invalid regex, such as ".\1" (there is no capture group that back reference \1 can refer to).  If the pattern is known statically, the syntax check will report this error, but for statements like "FIND REGEX pat IN text.", the actual pattern is only known at runtime.
    The cx_sy_matcher class (and its subclasses) similarly indicate some invalid states, for example trying to call "cl_abap_matcher->replace_found( )" when the matcher has no current match to replace (e.g., replace_found( ) called twice in a row).
    Please let me know if I can provide some additional information.
    Regards
    Ralph

  • [IPCC Express] Questions about database fields

    Hello,
    I'm developing some reports for Cisco IPCC Express.
    During the development, a lot of questions came out related to the definition of some fields:
    - In ContactCallDetail, what is the difference between transfer and redirect a call?
    - In ContactCallDetail, what is the difference between transfer = 1 and contactType=5? Both are related to transfering a call.
    I'll appreciate any help you can give me.
    Best Regards,
    Filipe Cruz - Portugal

    Where i can get that Enterprise Edition ?<br>
    here (click)<br>
    <br>
    does Express edition has Web based EM ?<br>Read the doc about Express Edition : Oracle Database 10g Express Edition<br>
    <br>
    Nicolas.

  • Expression questions

    In looking at the SQL that Toplink generates from the expressions one sees more joins than would be expected. Can somebody provide a reason for that ?
    Also would the usage of parentheses in the expressions make any change to the SQL that is generated ?
    I read in another post that Toplink only generates two children no matter how complicated the expression is. Can some explanation be given for this as well ? Does this impact how I design my expressions ?
    I dont have such a specific problem as such but answers to the above question would enhance my understanding of Toplinl

    In looking at the SQL that Toplink generates fromthe
    expressions one sees more joins than would be
    expected. Can somebody provide a reason for that ?Can you provide an example? The generated SQL is
    based on your mappings and on what you specify in
    your expression. For example, if you don't have
    indirection (lazy loading) turned on in a one:many
    relationship, then when you query for a 'one' you'll
    see a join between the table for the one and for the
    many.OK I will provide an example within the next couple of days.
    >
    Also would the usage of parentheses in the
    expressions make any change to the SQL that is
    generated ?Parenthesis in and of themselves don't affect the SQL
    but if you use parenthesis to change your query then
    yes, it will affect the SQL.
    I read in another post that Toplink onlygenerates
    two children no matter how complicated theexpression
    is. Can some explanation be given for this as well?
    I'm not sure what you mean by "generates". Can you
    give an example?
    Well I was referring to this post specifically. Can you tell me what that means exactly ?
    Re: Braces with ExpressionBuilder
    Why does Toplink process only two sub conditions at a time ?
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Extreme/Express Questions

    I have encountered several interesting issues. I have an Airport Extreme dual band
    in my basement, and an Express (n) extending my network two floors up. I set it up
    this way to provide better connectivity to my g devices that are also two floors up.
    I have my new iMAC in the same room as the g devices and the Express. I also use the Express to stream itunes from my iMAC to my stereo. Both Airport devices are set to default values concerning n/g/frquency etc. I left them "as is" because the guys in the Apple store told me doing so would work best for my configuration.
    Here is the issue, this morning I had my PC laptop (n) 1 floor up from the Extreme
    (n) connecting to the internet at 17-18 Mbps (speedtest.net). My iMAC 2 floors up
    would only connect at 4-5 Mbps. No other devices were powered on at that time (g
    devices were off). I thought this was odd, so unplugged the Express. Speed tests on
    my iMAC then produced an 8-9 Mbps connection. I plugged the Express back in and the
    speeds decreased to 4-5 Mbps. I changed the Express to join the network rather than
    extend and the speeds on the iMAC increased to 8-9 Mpbs again.
    First question: Does the Express decrease network speeds when extending a network,
    even when only n devices are active? If not, have I configured something incorrectly? Is there a fix?
    I then moved my iMAC next to my PC laptop (one floor above the Extreme) and tried
    speed tests again. The PC consistently came in at 17-18 Mbps while my iMAC came in
    at 12-13 Mbps even though they were so close they could be touching.
    Second question: Do I have something configured incorrectly? I recognize that the
    speedt ests are not the best measure of network speed, but there definitely is a real
    difference here.
    Any help is greatly appreciated!

    1. You cannot connect a hard drive to the Airport Express USB port.
    2. The speed of wireless networking is faster than the speed of most cable internet services. Therefore, you won't notice any difference in your internet connection speed between (a) a cabled connection directly between Mac and modem or (b) a wireless connection between Mac and base station and modem.
    3. Apple has not published any specs on the speed of hard drive access for the Airport Extreme N Base Station. Several people have posted their own measurements (do a search in this discussion forum), and generally those results are not very good.
    4. Apple has not placed a limit on the number of drives you can attach to the Airport Extreme N Base Station (with use of a hub). How many do you want to connect?
    5. You cannot remotely sync an iPod using the Extreme Base Station.

  • Help: Regular Expression question??

    Hello,
    How can I extract the following content using Java Regular expression?
    <tr bgcolor="#333333">
         <td class="title" colspan="4" height="18"> <b>SUPER_1</b> - SUPER_2</td>
    </tr>
    <tr bgcolor="#333333">
         <td class="match-light" width="45" height="18"> </td>
         <td class="match-light" colspan="3" width="286" align="right">March 19 </td>
    </tr>
    <tr>
         <td colspan="4" height="1"></td>
    </tr>
    <tr bgcolor="#cfcfcf">
         <td width="45" height="18"> FT</td>
         <td width="118" align="right">SUPER_3</td>
         <td width="50" align="center"><a class="scorelink" target="details" onclick="showDetails();">999 - 888</a></td>
         <td width="118">SUPER_4</td>
    </tr>From the above contents, How can I define a regular expression for extract the "*SUPER_1*", "*SUPER_2*", "*March 19*", "*SUPER_3*", "*999*", "*888*" and "*SUPER_4*" ????
    Please help.
    Best regards,
    Eric

    Kayaman wrote:
    Why not use a better way than regex, like an actual HTML parser (or XML if you have it well-formed)? People seem to love parsing (or rather, asking help how to parse) HTML with regex for some unknown reason.Indeed.
    Read this (hilarious):
    http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454

  • N00b Vi Q/reg expression for html

    How do I wrap <p> </p> tags around paragraphs globally??
    And when I try to wrap <i></i> around a line, i get the error E488: trailing characters.
    :28,32s/.*/<i>&</i>/g
    . I thought this would wrap italic markers around the whole lines from 28 to 32, what am I doing wrong?
    Oh, and if anyone has a link to a good tutorial for n00bs on global substitutions by regular expressions, don't keep it to yourselves. :-)
    Last edited by Reploid (2009-03-06 18:39:35)

    Thx @ Husio. Will experiment with script a little later, trying to learn the basic stuff for now.
    Another question:
    I have sentences like:
    <p><span class=font25>4th completely revised edition</span></p>
    However, I can only seem to substitute the sentences with font0-9. (!)
    This doesn't work:
    :%s<span class=font[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,2
    5,26,27,28,29,30]\+><b>\(.*\)<\/b><\/span>/\1/
    This doesn't work:
    :%s<span class=font[0-9][0-9]*>
    This doesn't work:
    <span class=font[0-9*][0-9*]>
    What would help me get rid of the formatting markup??
    Last edited by Reploid (2009-03-08 12:54:02)

Maybe you are looking for

  • Unable to deploy a bean

    I create the jar file as follows: java -cp D:\bea\wlserver6.1lib\weblogic.jar weblogic.ejbc -compiler javac D:\working\icechill\classes\ScipBeans.jar D:\bea\wlserver6.1\config\mydomain\applications\ScipBeans.jar After that I start my weblogic6.1 serv

  • Suddenly getting certificate authentication errors

    The last few weeks I'm suddenly getting tons of "Warning: the certificate isn't valid" error messages when I go to sites on Safari. Normal sites: Facebook, Chase bank, amazon -- nothing suspect or out of the ordinary.  I haven't downloaded anything s

  • Upgrade network card

    I have an T430U with the Intel 2230N wifi card. is there a possibility to upgrade to a different more stabile network card. I tried to install a different card from another Lenovo laptop, but i just prompted that the card was unrecognized.

  • ABAP Devlopment are reflecting on UI

    Hi all, Our ABAP consultants done a devlop to copy text from one document to other through copy control but it is working fine in GUI but at UI this copy control is not working. Please suggest me the solution for this. Regards Apoorva  A

  • Credit Card Processing With Web Tools

    If you have web tools installed with standard SAP B1, can you take a web credit card order and only authorize it on the web side and then later complete the credit card transaction at shipping time?  If so, can someone point me in the right direction