Regex for URL Expression

I am not a programmer, but I have to write a rule for CACHING the following URL that is being generated with "GET_QUERYSTRING".
/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=198&my=247&request=gettile&zoomlevel=3
As you can see, I would like to cache all the PNG map tiles, but I don't know how to come up with Regular Expression (regex) for the above URL.
Thanks,

are you talking about xml schema restriction?
<xs:element name="url">
  <xs:simpleType>
   <xs:restriction base="xs:string">
    <xs:pattern value="(https?://)?[-\w.]+(:\d{2,5})?(/([\w/_.]*)?)?" />
   </xs:restriction>
  </xs:simpleType>
</xs:element>

Similar Messages

  • Regex for url pattern validation

    Hi,
    I am trying to find a regex for Url pattern validation that is not too restrictive.
    Please let me know, if anyone is using a pattern for their applications.
    Thanks
    Mayank Sharma

    are you talking about xml schema restriction?
    <xs:element name="url">
      <xs:simpleType>
       <xs:restriction base="xs:string">
        <xs:pattern value="(https?://)?[-\w.]+(:\d{2,5})?(/([\w/_.]*)?)?" />
       </xs:restriction>
      </xs:simpleType>
    </xs:element>

  • Regex for URL Validation

    HI I am validating a field which takes a url as input from the user.So the url may contain http,https,ftp links or the user may specify the ip address.So can anyone please help me out to create a suitable regex for that.I just need to check the validness of link and not that it exists or not.

    here i have changed the regex as suggested by you but
    it returns true even for http://com.com@
    which is invalid.
    So it did not worked :-(It did not work, because you did not use it correct:
    public class Foo {
        private static boolean isValidUrl(String url) {
            return url.matches("(https?|ftp)://www\\.\\w+\\.\\w+");
        public static void main(String[] args) {
            String[] urls = {
                    "http://com.com@",
                    "http://www.com.com",
                    "http://www.com.nl",
                    "http://www.com.co.uk",
                    "http://www.com"
            for(String url : urls) {
                System.out.println(url+" valid? "+isValidUrl(url));
    }

  • Regex for arithmetic expressions

    Hi all,
    I am new to Java. I was wondering if anyone can help me understand how regular expressions work. My problem is how to come up with a regular expression that would match a simple arithmetic expression like:
    a + b + c + d
    And I want to capture things by groups. I largely suspect that I should use something like:
    (\\w+)(\\s\\+\\s(\\w+))*
    (I use the \\s here because \\b doesn't seem to work)
    would work by capturing the first word like sequence with (\\w+), and the succeeding repeats of the plus sign and another word being captured by (\\s\\+\\s(\\w+))*. Didn't work though. Can anyone tell me what's wrong and how to think of a better way of handling these sort of expressions?
    The code I tried goes like:
    String patt = "(\\w+)(\\s\\+\\s(\\w+))*";
    String feed = "a + b + c + d";
    Pattern p = Pattern.compile(patt);
    Matcher m = p.matcher(feed);
    /* here I want to see if the groupings work somehow*/
    if(m.find()){
    for(int i=0; i<=m.groupCount(); i++)
    System.out.println(m.group(i));
    Thanks

    Sorry about that. Here's the correctly formatted post:
    So, with a simple arithmetic expression like:
    a + b + c + dI want to capture things by groups and I thought of using something like:
    (\\w+)(\\s\\+\\s(\\w+))*(I use the \\s here because \\b doesn't seem to work)
    with the idea of capturing the first word like sequence with (\\w+), and the succeeding repeats of the plus sign and another word being captured by (\\s\\+\\s(\\w+))*. As this didn't work, can anyone tell me what's wrong and how to think of a better way of handling these sort of expressions?
    The code I tried goes like:
    String patt = "(\\w+)(\\s\\+\\s(\\w+))*";
    String feed = "a + b + c + d";
    Pattern p = Pattern.compile(patt);
    Matcher m = p.matcher(feed);then I want to see if the groupings work somehow
    if(m.find()){
    for(int i=0; i<=m.groupCount(); i++)
    System.out.println(m.group(i));
    }and yes, I am wondering if arithmetic parsing would be possible with regex. I have implemented something similar before using combinations of simple tokenization and character checks, but I want to make cleaner looking code. Would using regular expressions be a bad choice? What if I feed something like:
    (a + b) + (c + d)

  • Problem using regex for url

    Heres the problem im trying to match
    <b>Heres my text</b>
    and using this pattern
    Pattern rnpattern = Pattern.compile(".+rel-.+html.+id=.+>(.+)</a>.+");
    and I'm having to matches returned at all. Its actually pulling a full text file and running the pattern on a CharBuffer, but I dont think thats the issue. I have 2 other patterns being run the same way in the same file and theres no problem with them. I know the pattern is not optimized at all, Ive gone through about 15 different iterations of trying different combinations to try and get a match, and this is the last one I tried. the numbers in the url such as this one being 3533 change so that cant be static. And the text such as "Heres my text" changes and thats what I want to capture. If anyone could lend any assistance I would appreciate it.
    Chris N.

    http://www.foad.org/~abigail/Perl/url2.html

  • Regex for a URL

    How do I write a regex for the following URL. I am trying to write a regex rule in Oracle WebCache.
    /myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=198&my=247&request=gettile&zoomlevel=3
    Thanks,

    I would start with a not so restrictiv expression.
    something like
    SQL> with testdata as (select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=198&my=247&request=gettile&zoomlevel=3' urlstring from dual union all
      2                    select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=200&my=300&request=gettile&zoomlevel=180' urlstring from dual union all
      3                    select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&my=300&mx=200&request=gettile&zoomlevel=0' urlstring from dual union all
      4                    select '/myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map&mx=100&my=200&request=gettile' urlstring from dual union all
      5                    select 'somethingelse' urlstring from dual)
      6  select urlstring
      7  from testdata
      8  where regexp_like(urlstring,'^/myserver.domain.com:7779/mapviewer/mcserver[?]format=[PNG|SVG].+[mapcache=mvdemo.demo_map].+[request=gettile]');
    URLSTRING
    /myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
    &mx=198&my=247&request=gettile&zoomlevel=3
    /myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
    &mx=200&my=300&request=gettile&zoomlevel=180
    /myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
    &my=300&mx=200&request=gettile&zoomlevel=0
    /myserver.domain.com:7779/mapviewer/mcserver?format=PNG&mapcache=mvdemo.demo_map
    &mx=100&my=200&request=gettile
    SQL> In this example the url needs to include the mapcache, format and request parameter.
    Edited by: Sven W. on Oct 29, 2008 7:23 PM

  • Can somebody help me in getting some good material for Regular Expressions and IP Community list

    can somebody help me in getting some good material for Regular Expressions and IP Community list

    I'm not sure what you mean by "IP Community list", but here are 3 reference sites for Regular Expressions:
    Regular Expression Tutorial - Learn How to Use Regular Expressions
    http://www.regular-expressions.info/tutorial.html
    Regular Expressions Cheat Sheet by DaveChild
    http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/
    Regular Expressions Quick Reference
    http://www.autohotkey.com/docs/misc/RegEx-QuickRef.htm

  • [svn:fx-3.x] 11086: Fixing Safari 4.x support for url change detection.

    Revision: 11086
    Author:   [email protected]
    Date:     2009-10-22 11:42:17 -0700 (Thu, 22 Oct 2009)
    Log Message:
    Fixing Safari 4.x support for url change detection.
    QE notes: None
    Doc notes: None
    Bugs: SDK-22483
    Reviewer: Alex
    Tests run: Manual browser test.
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22483
    Modified Paths:
        flex/sdk/branches/3.x/templates/html-templates/client-side-detection-with-history/history /history.js
        flex/sdk/branches/3.x/templates/html-templates/express-installation-with-history/history/ history.js
        flex/sdk/branches/3.x/templates/html-templates/no-player-detection-with-history/history/h istory.js

    HI,
    Go to ~Library/Internet Plugins. You should see: Glims
    "/Library/InputManagers/Glims/Glims.bundle/Contents/MacOS/Glims"
    Delete Glims from the system and restart your Mac.
    If you need help uninstalling Glims go here.
    Safari 4: May unexpectedly quit with "Glims for Safari" Read where you see: Resolution.
    Carolyn
    Message was edited by: Carolyn Samit

  • "Note to seller" missing for PayPal Express - in-context for mobile devices

    See subject... I am helping a friend with his website where we use a shopping solution for a wordpress website that integrates with paypal express. It uses "paypal express -  in context" ... unfortunately it appears "note to seller" is not yet implemented for "paypal express -  in context" when viewed on e.g. smartphones ... is there any ETA for this? It is a pretty vital field in our case...  https://developer.paypal.com/docs/classic/express-checkout/in-context/popup/
    https://developer.paypal.com/docs/classic/express-checkout/in-context/integration/ (would appreciate it greatly if this field could be supported soon9

    Actually I am not 100% sure. From the looks of it I am using "in-context", but the code my shopping cart uses (Cart66) does not seem to use the new URL the PayPal documentation dictates.  Anyhow, the problem remains. The notes field is not shown to mobile users. I think that it is somewhat odd to support it for orders coming through desktop, but not support it for mobile. I hope I am missing something

  • How to remove bullets and spacing for url links in the Related Links iview?

    I tried to look for a property that I can edit the look-n-feel of the url links in the Related Link iView using "Theme Editor".
    All I need is to remove the bullets and increase some vertical spacing between the links.
    Currently, it looks like this:
    URL iView A
    URL Iview B
    I go through the whole section of Related Links properties, none of them seems to do what I want.
    Here are the list of properties in Related Link section (of Navigation Panel):
    Link Color
    Text Decoration of Link
    Hover Color
    Text Decoration of Hovered Link
    Initially, I thought "Text Decoration of Link" should be the right property I should look at. But there are a drop-down with 5 options: None, Underline, Blinking, Overline and Line-Through, which really can't achieve what I want.
    Thanks for advice.
    Kent
    Post with Diagram Illustration:
    <a href="http://sapnetweaverforum.blogspot.com/2006/11/how-to-remove-bullets-and-spacing-for.html">How to remove bullets and spacing for url links in the Related Links iview?</a>
    Message was edited by: Kent C.

    Hi, Kai.
    I checked the Related iView properties (URL Template), I don't see what layoutset it is really using. I am not sure, is that a layout set apply to the Related Link Iview?
    For the regular KM iView, I will see what Layout Set I want to apply, then I can go and change the properties (of layout coontroller, collection renderer & resource renderer)you mentioned. But for this Related Link iView, I really don't know. I guess it may be in the code itself.
    If there is a layout set for Related Link iView (or the place to apply layout set to it), can you point to me which one is that? (I did a search through the layout set names, I only find the AppQuicklinkExplorer (I used this for Dynamic Nav. Link iView before), if I can aply this layout set to Related Link iView, my problem will be solved.)
    Thanks for help.
    Kent

  • Can we handle exceptions for the expressions in select query?

    Hi all,
    Can we handle exceptions for the expressions in select query.
    I created a view, there I am extracting a substring from a character data and expected that as a number.
    For example consider the following query.
    SQL> select to_number( substr('r01',2,2) ) from dual;
    TO_NUMBER(SUBSTR('R01',2,2))
    1
    Here we got the value as "1".
    Consider the following query.
    SQL> select to_number( substr('rr1',2,2) ) from dual;
    select to_number( substr('rr1',2,2) ) from dual
    ORA-01722: invalid number
    For this I got error. Because the substr returns "r1" which is expected to be as number. So it returns "Invalid number".
    So, without using procedures or functions can we handle these type of exceptions?
    I am using Oracle 10 G.
    Thanks in advance.
    Thank you,
    Regards,
    Gowtham Sen.

    SQL> select decode(ltrim(rtrim(translate(substr('r21', 2, 2), '0123456789', ' ' ), ' '), ' '), null, (substr('r21', 2, 2)), null) from dual;
    DE
    21
    SQL> ed a
    SQL> select decode(ltrim(rtrim(translate(substr('rr1', 2, 2), '0123456789', ' ' ), ' '), ' '), null, (substr('rr1', 2, 2)), null) from dual;
    D
    -

  • JDeveloper 11.1.1.2.0 Support for Dimension Express

    The JDev extension for Dimension Express is not working correctly. After downloading, and successfully connecting to the repository, none of the versioning menu items are enabled? The documentation is also inconsistent with the actual procedure to connect to the repository.
    We are running Dimension Express 2009 R2.

    JDeveloper does not have a specific extension for Serena Dimensions Express but has a extension for Serena Dimensions. Serena Dimensions and Serena Dimensions Express are two different products that share common technology.
    You may be able to use the Dimensions extensions to connect to Dimensions Express if you can. Invoke the versioning navigator View -> Team -> Version Navigator. Open the dimensions node and see if you can browse the connection you created.
    Dave

  • Plug-Ins for Logic Express 9

    Does anyone know of any sites where one can download plug-ins for Logic Express 9 (either for free or for purchase)? Also, I know that one can use sound fonts (.au) with GarageBand --do these also work in Logic Express 9 and, if so, do they need to be reinstalled for Logic or do both programs read the same source files?
    Thank you!

    To piggy back on previous posts, I would definitely pursue Native Instruments. While some may of the plug-ins may seem a bit on the pricey side, you will certainly get your money's worth. If you're looking for strong lead and bass sounds, I would encourage you to check out Massiv - it's my go-to plug-in of choice. I believe there is even a limited demo to try if you want to play around before purchasing.
    Hope this helps.
    Message was edited by: lostinthesound (spelling correction)

  • Object Services Attachements for URL Links

    Hi Guru,
      I have to create interface for Object Services Attachments for URL links.
    Scenario is
    Drad Table:
    DOKOB = PTRV_HEAD
    DOKNR = 0000000000000001000000000098
    objky = 0050000088\
    Draw Table:
    doknr = 0000000000000001000000000098
    filep: rgenbust:/DCTM370097578000AD0C
    Create object service url attachment with:
    http://rdgvmws10:8080/WebAccess/TEServlet.ser?docbase=rgenbust&sapLinkId=
    appended to FILEP after the /
    to make a link of:
    http://rdgvmws10:8080/WebAccess/TEServlet.ser?docbase=rgenbust&sapLinkId= DCTM370097578000AD0C
    I unable solve this issue can any help with the source code.
    I need to create program with scratch. Can any body tell me how to start the program. First which table i need to read. How to retrieve URL append to FILEP field. I would appreciate if any body help.
    Thanks
    Ashraf

    Hello,
    See hyper-links below:
    [How-To: Offline approval - Logon link does not work|http://wiki.sdn.sap.com/wiki/display/SRM/Offlineapproval-Logonlinkdoesnot+work]
    [KBA 1511180 - The hyperlink in the offline approval email is incorrect|https://service.sap.com/sap/support/notes/1511180]
    Regards.
    Laurent.

  • Java.io.FileNotFoundException: Response: '404: Not Found' for url:

    Hello,
    I am in the processing porting a J2EE based application deployed originally in OC4J to WLS. I am not changing anything as far as J2EE/Web configuration files such as web.xml. Whenever I hit the URL of the application, I am getting the below exception.
    What does usually "java.io.FileNotFoundException: Response: '404: Not Found' for url...." indicate?
    If you could please give me some pointers to narrow down the places to look, I would appreciate it.
    Thanks,
    Mustafa
    java.io.FileNotFoundException: Response: '404: Not Found' for url: 'http://cayc
    001geo1:7001/IUS_Editor/mapservlet'
    at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnectionjava:487)
    at weblogic.net.http.SOAPHttpURLConnection.getInputStream(SOAPHttpURLConection.java:37)
    at oracle.lbs.mapclient.MapViewer.getXMLResponse(MapViewer.java:6013)
    at oracle.lbs.mapclient.MapViewer.getDataSources(MapViewer.java:629)
    at gov.census.geo.maftiger.interactiveupdate.navigation.mapservlet.ISGegraphyController.getMapviewerDS(ISGeographyController.java:730)
    at gov.census.geo.maftiger.interactiveupdate.navigation.mapservlet.ISGegraphyController.doPost(ISGeographyController.java:161)
    at gov.census.geo.maftiger.interactiveupdate.navigation.mapservlet.ISGegraphyController.doGet(ISGeographyController.java:73)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.ru(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurtyHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.ja
    a:300)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.ja
    a:184)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActi

    Hello,
    I was able to sort out this issue. I was comparing the web.xml and found out that the servlet-mapping was missing.
    Thanks,
    Mustafa

Maybe you are looking for

  • Error while creating Business Agreement from IC web Client

    Dear Experts, I am working on IC Web Client ( CRM 7.0) & ISU (ECC 6). I was able to create the Business Agreement & sucessfully replicate the same to ISU as a COntract Account. But when I Try to create the Business Agreement from ICWebClient I am gwt

  • Import from HD folder with NEF and JPEG files-Can't see JPEG files

    I am using Aperture 2 and I am trying to import from an external HD folder of images, with both NEF and JPEG files of the same photo. Using the import function, the import pane only shows the NEF file, not the JPEG file. Is there a setting somewhere

  • Archiving -Balance sheet GLs

    Hi , We have done the archiving with archiving object FI_document for the year 2009. But i am not able to tally the open value  as on today for the GLs which are not managed as open item ( i.e only line item based.) But for customer , vendor and Gls

  • Create UserFields second time

    Hi SBO-Forum, I wrote code to create user defined table and fields - that works fine first time (DI API, version 2004A, C#). I don't wrote code to remove this tables/fields automatically ... I made it manually. I cleared my entries from tables OUTB,

  • Security Network Layer (SNC) error when creating new session

    in SAPGUI 710, suddenly some users are getting a popup message ("Security Network Layer SNC error") when they use the Create New Session toolbar button. SSO works fine when they connect from SAP Logon, its only when attempting to open secondary sessi