• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Third Party Jar - Regular Expression Pattern
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Third Party Jar - Regular Expression Pattern


  • Subject: Re: Third Party Jar - Regular Expression Pattern
  • From: Art Isbell <email@hidden>
  • Date: Sat, 29 Mar 2003 10:02:32 -1000

On Saturday, March 29, 2003, at 05:31  AM, Jonathan Fleming wrote:

I'm, using this syntax for regular expressions:
Regex cleaner = new Regex("(?:[\\/:?*\"<>|-]){1,}|(?:\\s+)","_");
in RegEx from the Package com.stevesoft.pat version 1.5 of Regular Expressions in Java


Does any one know how to get this to substitute a backslash from a string

===RegEx Syntax is OK(?:(?:[/:?*\"<>|\-]){1,}(?# <= fast multi)|(?:[  -
]{1,}(?# <= fast multi)){1,})

This seems odd to me. The reading, writing, and Regex processing of the regex string aren't removing the backslash that protects the double quote, yet both the initial two backslashes are removed and a backslash has been added to protect the dash! So it's difficult to know from where you've output the regex string what's happening.


The Apache Jakarta regex package I'm using (http://jakarta.apache.org/regexp/) uses a regex format that's more familiar to me and that supports specifying a backslash character in a regex string using two backslash characters as you've done. In cases like this, I've resorted to trying three or four backslashes in hopes that something will work. If not, I'd consider trying the Jakarta package instead. You shouldn't have to waste time on stuff like this.

Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Third Party Jar - Regular Expression Pattern (From: "Jonathan Fleming" <email@hidden>)

  • Prev by Date: PBX doesn't like seventies
  • Next by Date: Re: Third Party Jar - Regular Expression Pattern
  • Previous by thread: Third Party Jar - Regular Expression Pattern
  • Next by thread: Re: Third Party Jar - Regular Expression Pattern
  • Index(es):
    • Date
    • Thread