Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Browse by Tags

All Tags » java
  • Extracting from an already-extracted pattern

    In a Java environment, I want to build one or more patterns that enable me to get two 'views' from the same piece of matched text.  For example, if I have a numeric pattern like '1234', I want to build 'view-2' and 'view-4' versions of the match.  'view-2' would return '12' and ...
    Posted to Construction Advice (Forum) by brwarn on June 25, 2008
  • Extract Number, Then Throw Away Trailing Characters/Zeros

    In a Java environment, how do I convert a pattern like 'ABC: 1230-00' to '1230'?  The following pattern I believe will work to get '1230-00', but I can't figure out how to remove the '-00' part.  Thanks. Remove 'ABC:' part: (?<=ABC:?\s{0,2})\\d{2}00-00 
    Posted to Construction Advice (Forum) by brwarn on June 25, 2008
  • Check hexadecimal character codes in Java String

    Hello,  I try to check hexadecimal character codes according to this specification : "Only allow characters which hexadecimal code is between 20 and 7E".  I tried this : myString.matches("[\\x20-\\7E]"); but it doesn't work.  Any idea ?  
    Posted to Construction Advice (Forum) by Chickadee on March 31, 2008
  • REGEX solution for a URL

    Hi All, I am trying to find out a regex pattern for a particular URL type, to extract a particular piece of information from that URL. I am working on JAVA and the URL sample goes like this lid={ifpdf:92000000000012345}{ifnonpdf:33000000000012345}&cadid=12345}  I am trying to search for the italicized part of the ...
    Posted to Construction Advice (Forum) by kedar on November 15, 2007
  • Manipulating an HTML document using regular expressions.

    I want to manipulate an HTML document using regular expressions. I want to add disable='true' in all input fields not having id='controlId1' in an HTML document. I am using Java 1.5. I have written following incomplete code. String htmlDoc = "<INPUT type=\"button\" id='controlId1'  ...
    Posted to Construction Advice (Forum) by Naeem on November 12, 2007
  • extracting the common name from a distinguished name

    I am using Java's regular expression library.  I need to extract the common name from an active directory's distinguished name for a user. I have the String representation of a user's distinguished name. The only portion I need or care about is the common name. I am trying to write a regular expression that will extract that ...
    Posted to Construction Advice (Forum) by spjohnston on October 24, 2007
  • Excluding * and % from string

    Hello All,  I am just learning regex, I need to give a alert when user enters % or * signs anywhere in the name field of my Struts(java) app.  I have ^[^%*]+$  this working but just wanted to make sure I have it correct.  Thanks in advance for help. Regards, Srini ^[^%*]+$  this working but just wanted to make sure I ...
    Posted to Construction Advice (Forum) by Srini on August 27, 2007
  • Simple password validation that is confusing me.

    Greetings - I've been tasked with coming up with an expression that would do password validation for our application. After doing a search for ideas I came across this site and this is the solution I was able to come up with: Language: Java Problem: A valid password is a minimum of eight characters and a maximum of sixteen. It contatins at ...
    Posted to Construction Advice (Forum) by Noiroi on July 12, 2007
  • Re: How to make a carrige return?

    To keep truly platform independent when using Java you should always consider using System.getProperty("line.separator"); instead of \r, \n or the combination of both. String NewText = matcher.replaceAll("-- $0 *by migration" + System.getProperty("line.separator") + "Second_String");  
    Posted to Construction Advice (Forum) by eSquire on April 24, 2007