Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: Pattern for matching parts of url

  1. #1
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default Pattern for matching parts of url

    Hello,

    I have the following pattern: www.domain.com:8051/(.*)/(.*)

    And the following two urls:

    www.domain.com:8051/first/second

    www.domain.com:8051/first/second/third/fourth

    Both urls matches. But I only want to match the first one. What must I do to exclude the "/" as a character to match?

    Thanks, Joan.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Pattern for matching parts of url

    Quote Originally Posted by joan.balaguero View Post
    Both urls matches.
    Here's another URL that matches:
    regex - Pattern for matching pieces of url - Stack Overflow

    db
    quad64bit likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Please Help me regarding String pattern matching
    By theyoung in forum New To Java
    Replies: 11
    Last Post: 11-08-2011, 02:59 AM
  2. A Question Regarding Pattern Matching
    By hadi in forum Advanced Java
    Replies: 4
    Last Post: 01-21-2011, 03:38 PM
  3. pattern matching with two arrays
    By jessie in forum New To Java
    Replies: 10
    Last Post: 11-24-2010, 04:00 PM
  4. String matching a pattern
    By vividcooper in forum New To Java
    Replies: 7
    Last Post: 01-07-2010, 10:30 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •