Reg expression - how to set patterns

all,
i'm struggling to get the pattern thing to work in java - its probably beacuse i dont understand the syntax properly and at moment cant find any proper resourse to point me in the right direction. so although this is probably very easy but all i need to do is split string (1967-1969) into two - ie i want
var1=1967;
and var2=1969;i.e in the string want to find the pattern of "-"
and if found split else its only a single year and just take it as it is
i'm trying below code but obviously have the syntax wrong
please can some one tell me how to set the pattern and ideally a resource where i can get a quick ref at the diffrent meaning of the syntax
Pattern p = Pattern.compile("-(.*?)-");
                  Matcher m = p.matcher(year);
                 boolean b = m.find();
                        if (b == true)
                      String[] result = p.split(year);
                           if (log.isDebugEnabled())
                               log.debug("a year range was found the values are "+m.group(1));
                               log.debug("a year range was found the values are lower limit: "+result[0]);
                               log.debug("a year range was found the values are upper limit: "+result[1]);
                               }

String[] result = year.split("-");
or
Pattern pattern = Pattern.compile("([^-])+-(.*)");
Matcher matcher = pattern.matcher(year);
if (matcher.matches())
String var1 = matcher.group(1);
String var2 = matcher.group(2);
}

Similar Messages

  • Airport Express - How to set proxy settings?

    Hello all
    I have an AirPort Express in for testing at work.
    The internet access at work requires going through a proxy. This proxy gets set on domain clients via gpo.
    We have some devices we dont want to put on the domain (wont get the gpo) but we need them to have internet access.
    We could set the proxy on these devices manauly but theres a lot of them.
    I have been trying to find where in the Airports settings you can set proxy settings but cant find anything.
    Can you set proxy settings manualy in the device and if so, where abouts?
    I'm using windows for accessing the Airports settings.
    Thanks for any help someone can offer.

    unfortunately i have to use 1.4 which makes this a bit more tricky.
    my other idea was to use system.setProperties to set the 2 proxy fields and then afterwards set them back to what they were -- however in the case they were null I get an NPE when I try and set them back, so I'd need a workaround for that as well.

  • How To Set Up Airport Express To Use With iPad2 For My Needs ?

    On the advice of several people in a audio forum, I just purchase an Apple Airport Express. I will be using it with my new iPad 2. What I need to accomplish is using my iPad2 to stream subscription based music from the internet to the Airport Express, and for the Airport Express to connect via toslink cable to the DAC in my audio system.
    What I am not sure about is how to set up my Airport Express to accomplish this. I do have a wireless network in my home, but wish to keep the wireless connectivity between the Airport Express and the iPad2 separate from it.
    I would greatly appreciate any assistance with this. Thanks.

    Deggie, firstly, thank you for your attempt to help. I greatly appreciate it. I connected it via the ethernet cable to the router since when I reconfigured the Airport Express adding it to my existing wireless system, the iPad could not connect to anything until I unplugged the Airport Express. I set it up for an ethernet connection to my router based on that experience.
    Either the Ipad does not seem able to send anything to the Airport Express, or the AEX is not passing anything on. I also tried streaming a song stored on the iPad 2 to the AEX with no result, so it is not an issue with the subscription channel.
    I don't own a miniplug cable of any sort for further testing, but the toslink cable is brand new, and was literally taken out of its package and plugged in, so I feel it extremely unlikely it is the issue. I've also tested it in three inputs on the DAC, so it is definitely not an issue with it.
    I have a question though. You said "when you start your subscription and go to Airplay, does the iPad see the AEX?" You may be on to something there. How do I "go to Airplay" I thought it was just automatic?  Also, how do I "select it"? This may be the problem.

  • I have an airport express and want to know how to set up two different wireless networks. One with 5GHZ and one with 2.4GHZ so different devices can connect to either.

    I have an airport express and want to know how to set up two different wireless networks. One with 5GHZ and one with 2.4GHZ so different devices can connect to either. I have an iphone 4 that will not connect to 5ghz.
    thank you!

    Your AirPort Express is already providing two separate 2.4 GHz and 5 GHz bands, but each band is using the same wireless network name.
    This is the default setup for the AirPort Express, which is recommended for most users. The theory here is that devices will automatically connect to the best quality signal based on their capabilities and distance in relation to the AirPort Express.
    It is possible to assign a different name to the 5 GHz band, and then "point" devices at that network to connect. Some users swear by this option.....(I am not one of them).... but you might want to give it a try to see how it works for you.
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click on the AirPort Express
    Click Edit in the smaller window that appears
    Click the Wireless tab at the top of the next window
    Click Wireless Options near the bottom of the next window
    Enter a check mark next to 5 GHz Name.....which will automatically add "5 GHz" to the network name....so you can identify it
    Click Save, then click Update and wait a full minute for the Express to restart
    Now you will need to "point" your 5 GHz capable devices at the 5 GHz network name.  2.4 GHz devices will connect to your "other" network name.

  • How to set up Airport Express to extend Buffalo WHR HP 54g wireless router

    Contrary to what official Apple policy is, it is possible to use Airport Express as a remote repeater using a Buffalo router.
    I sent hours setting up this network and wish to share what I learned
    I only wanted to use the Airport Express as a repeater to distribute the internet to the far reaches of the house--no iTunes, no Printer, and I did not bother setting security.  If you want to add any of those features please make sure that the basic setup is working as described below.  I have no idea how to successfully set up these features.  My advice is to search the internet for guidance.
    Anyway:  how to set up the Buffalo wireless access router to work with Airport Express
    Setting up the Buffalo:
    From the routers home page of 192.168.11.1, hit the "advanced" box at the top
    1.     Go the "Wireless config"   "basic" item.  Give name to your network (spaces are allowed), lets call it "WIRENAME" and select wireless channel 1 or 6 or 11. These channels have the least interference and will tend to work when the others do not.
    2.     Go the the "repeater" item under Wireless config.  . " Enable" repeater/bridge (WDS).  Next register the MAC address of the Airport Express.  Record both the LAN and Wireless MAC addresses. 
    That is about it.  Your Buffalo system Info page should look like this
    Model             
    WHR-HP-G54 Ver.1.40        (1.0.37-1.08-1.04)                       
                        AirStation Name              AP001D73DEB2D6                    Operational Mode                Router Mode                    WAN                                                                                                                                                                                                                                                                                                                                                                                                      
    DHCP
    Connection Status
    Communicating
    Operation
    IP Address
    myinfo
    Subnet Mask
    255.255.255.248 
    Default Gateway
    my info(Via DHCP)
    DNS1(Primary)
    my info (Via DHCP)
    DNS2(Secondary)
    my info (Via DHCP)
    Host Name
    my info (Manual Setup)                  
    Domain Name
    earthlink.net (Via DHCP)
    MTU Size
    1500
    DHCP Server Address
    10.108.48.1
    Lease Acquired Time
    2006/01/04 12:03:15
    Lease Period
    2006/01/05 12:03:15
    Wired Link
    100Base-TX                                (Full-duplex)                          
    MAC Address
    00:1D:73:xx:xx:xx
                        LAN                                                                                                                                                                                                                     
    IP Address
    192.168.11.1
    Subnet Mask
    255.255.255.0
    DHCP Server
    Enabled
    MAC Address
    your address recorded in the repeater tab
                   Wireless(802.11g)                                                                                                                                                                                                                                                                                    
    Wireless Status
    Enabled           
    SSID
                                          WIRENAME
    Encryption Mode
    Not Configured           
    Wireless Channel
    11Channel                 (Manual)           
    125* High Speed Mode
                                 Disabled           
    MAC Address
    your address recorded in the repeater tab
    For the Airport express: here is a summary of what the settings are:  Start Airport Express Utility and when it comes up
    Select "Manual" setup
    On the Base station tab:  Give Airport Express a name, any name and any password.  Do not select the box:  Allow setup over the internet with Bonjour
    On the wireless tab:  Wireless mode: Participate in a WDS network
    Network name:  the name you gave in the Buffalo router: EG:  WIRENAME
    Radio mode: 802.11n(802.11b/g compatible)
    Channel : the same as you set in the Buffalo
    Wireless security: None
    WDS tab:  WDS mode: WDS remote
    Check: allow wireless clients
    WDS main: the MAC address of the wireless (not LAN) side of the Buffalo router
    Access control tab: MAC address access control: Not enabled
    At the top of the control box , click on the Internet icon
         Internet connection: Connection sharing: Off (Bridge Mode)
         TCP/IP: Configure iPV4 : Using DHCP
         I put in the address of the DNS servers listed on the Buffalo System info page above.
    At the top of the control box Music Icon: I did not enable AirTunes
    Printer icon: did not set this up
    Advanced icon: leave every thing alone
    That is it.  Just do everything as above and your Airport Express will act as a repeater.  (And save yourself a couple of days struggle.)
    Phil

    Many thanks for the info.
    In case you were not aware,the following list of Apple WDS compatible devices has appeared on numerous sites and in numerous Internet links and articles regarding this subject:
    3com OfficeConnect ADSL Wireless 11g Firewall Router model 3crwdr100a-72 but ONLY with NO encryption
    Belkin F5D7230-4 and F5D7231
    BT Voyager 2091 or 2100
    Buffalo WGR-G54
    Linksys WRT54G or WRT54GS (though v4)
    Netgear WGR614 v6

  • How to set up the airport express with a linksys wireless-g broadband router

    I need to know if and how to set up an airport express to use to extend a home wi-fi network. I have AT&T service with a 2WIRE modem. I am using a Linksys wireless-G broadband router. I also have the new Macbook Air notebook. The airport express keeps giving me a blinking amber light even when the ethernet cable (from the modem) connected. Please let me know how to set up an extended wifi network using this system. Any help would be appreciated.

    If that is all that is done, the Express would not provide more wireless coverage.  Instead, it would duplicate the coverage provided by the Linksys and there would be two WiFi systems covering approximately the same area.  As per my above comment, one Express connects via Ethernet to the Linksys.  The second Express provides the extension.
    You must have misunderstood what I was saying.
    Linksys is providing a wireless network.
    The Express is connected to one of the LAN ports on the Linksys router using a long Ethernet cable (or Ethernet powerline adapters)
    The Express is located on the other side of the house, for example.
    The Express is configured to create a wireless network using the same wireless network name, security and password as the Linksys router
    The Express is configured in Bridge Mode
    This has worked quite well for me for years. Computers "switch" from one wireless access point to another smoothly and automatically while they move around the house.
    Although this is an "extended" network, it is technically known as a "roaming" network.
    This is what I was suggesting as a possible alternative without having to buy more hardware.

  • How to set up Airport Express in Bridge mode for hotel use

    Please provide step by step instructions on how to set up Airport Express in Bridge mode for hotel use. I do not have a computer with me, only an iPhone and AEX 802.11n.

    +"Please provide step by step instructions on how to set up Airport Express in Bridge mode for hotel use. I do not have a computer with me, only an iPhone and AEX 802.11n."+
    AirPort Utility is the application that must be used to setup and make any configuration changes to the AirPort Express. I'm not aware of an "App" for this.
    If you could borrow a computer from someone there for 30 minutes or maybe use the computer in the lobby, you could download AirPort Utility and reconfigure your Express. To help with setup, use an ethernet cable from the computer to the Express to help AirPort Utility "see" the Express.
    http://support.apple.com/downloads/#airport

  • How to set up and configure AirPort Express for AirPlay and iTunes

    Saw somewhere that supposedly there were some apple written guidlines on the above topic. I have searched all over for them. Anyone know where I can get a copy to read through. Just trying to educate myself a bit and sety up another room with access to itunes, radio, etc with high quality speakers and amp off my express.

    Here you go ...
    How to set up and configure AirPort Express for AirPlay and iTunes

  • How to set up Express as a relay wireless base station ? System: Yosemite

    How to set up Express as a relay wireless station ?
    OS: Yosemite.
    Airport utility: 6.3.4
    Base station: Extreme, connected to modem.  Configured as "create a wireless network"
    Remote stations: Express, connected wireless as "extend a wireless network"
    Need relay station between Extreme and Express units.
    Airport utility doesn't give the "relay" option.

    Sorry, but Apple does not provide a "relay" option. The network can only be extended one time, not two.
    Move the remote station closer to the main station, or move the main station closer to the remote station, or move both closer together.

  • How to set a password on my airpot express?

    I am using for more than 5 years and i still don't know how to set tha password on it. any one can help?

    Assuming you mean the name and password of the Express itself, connected to the Express, open AirPort Utility on your computer, Select the Express from the list on the left side of the window, choose manual setup, the default password is public you can now rename the Express and change its password, and when finished Update.
    Edit: let me correct what I said above, use the assist mode for this work, it is very easy that way.

  • HT3728 after soft resetting how to set a new password to my airport express

    after soft resetting the airport exppress how to set a new password to my airport express

    Hello, MevanK.
    Thank you for the question.  You may find this article helpful in changing or creating a password for your AirPort Express. 
    AirPort Utility 6.x: Password-protect your wireless network
    http://support.apple.com/kb/PH5119
    Cheers,
    Jason H. 

  • How to correctly write an MDX expression for a set

    Hello, 
    i've got 2 dimension hierarchies:
    1) [Hierarchy1].[CityOfBirth]
    2) [Hierarchy2].[CityOfResidence]
    Both these hierarchies contain same members - cities
    How do I write an MDX expression for a set containing all possible combinations of both dimensions ([Hierarchy1].[CityOfBirth].Member, [Hierarchy2].[CityOfResidence].Member)
    but excluding those tuples where [Hierarchy1].[CityOfBirth].Member = [Hierarchy2].[CityOfResidence].Member.
    I.e. there shouldn't be tuples like (New York, New York) or (Chicago, Chicago) in the set.

    Hi,
    depending on the structure of your hierarchies, someting like the following should work:
    SELECT
    {} ON 0
    ,Filter
    [Hierarchy1].[CityOfBirth]
    [[Hierarchy2].[CityOfResidence]
    [Hierarchy1].CurrentMember.Name
    <>
    [[Hierarchy2].CurrentMember.Name
    ) ON 1
    FROM [Your Cube];
    The way the cities are expressed should of course be the same: "NY" is different from "New York"
    Something about the same in the adventure works cube for testing.  the two geography hierarchies are here from a different dimension:
    SELECT
    {} ON 0
    ,Filter
    [Customer].[Customer Geography].[Country]
    [Geography].[Geography].[Country]
    [Customer].[Customer Geography].CurrentMember.Name
    <>
    [Geography].[Geography].CurrentMember.Name
    ) ON 1
    FROM [Adventure Works];
    Philip,

  • 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}$

  • HT4587 How to set up an older version Airport Express on the 6.2 Utility

    I have a older version of Aiport Express  (M9470LL/A model A1084) and I get the following message when I try to set it up with the Airport Utility Version 6.2 on my iMac with Snow Leopard 10.8.2. -
    "This version of AirPort Utility doesn’t support this base station. Go to AirPort Service and Support for more information."
    Any advice on how to set it up ?

    Mountain Lion no longer supports the older A1084 AirPort Express that you have.
    If you want to try a workaround.....not supported by Apple.....see this article to find out how to add another version of AirPort Utility that will work with Mountain Lion and hopefully allow you to configure the AirPort Express that you have.
    http://www.macworld.com/article/1167965/mountain_lion_and_the_ancient_airport_ba se_station.html

  • How to set up TimeCapsule (4th) to create own private (wired) network behind Airport Express (5th) that is set up to join existing wifi-network of fritz adsl modem/router?

    I work in an office building with free Wifi to connect to the Internet. I want to be able to use this internetconnection, but at the same time I want to shield of my own wired network.
    I've made the following configuration:
    - fritz adsl modem / router
    - Airport Extreme (5th gen) set up to join existing wireless network (green light, works)
    - Lan-cable from lan-port AE to wan-port TC (4th gen)
    - Lan-cable from TC to Mac
    - Lan-cable from TC to Printer
    When I set my TC (network-settings) in bridge-mode everything works fine, but my Mac and Printer get an IP-address from the fritz modem / router and are visible to others.
    I tried to set TC in NAT/DHCP-mode, but then I get the error message that I should set a static IP-adress for TC. When I set TC in DHCP-mode, it looses connection to the AE. I'm not sure what to do now. Does anyone know how to set up my TC and create my own private network and still be able to get on the internet?

    Hajenius wrote:
    Is there a better alternative? I'd rather not want to reset my TC every day.
    You are using free internet.. so there is a price to pay.. that is convenience and non-ideal network setup.
    The better alternative is to pay for your own connection. Then you are completely free of the possibility of others in the bullding seeing your connection. (as long as you secure the wireless).
    But I think you are probably over worrying about public wifi.. if it is setup right.. ask the building admins.. it should be setup so each user cannot see another users connection. This is typical for most wifi setup and simply means you can see internet connection but nobody else on the connection. ie other wireless users.
    Having a router with NAT makes it then more secure again and allows clients on your own network to interact with each other. But you can setup wireless to the free wifi for every client.. (depending on how many IP you are allowed).. and run a secondary network without internet access. This is easy for desktop etc where you have a wireless and a wired connection but less convenient for mobile devices.. unless you use a cloud connection and each client can link and share via that.
    Have I made the explanation worse??
    Think of it this way.. if you had 3 laptops.. all 3 could connect to the internet from the building wifi.. but they cannot talk to each other or share resources in local office. You can put resources out in the cloud, that can be shared.. but that adds traffic and most free services are not fast.
    Now you can also plug all three into Time Capsule by ethernet.. and share local resources. Files, printers backup etc. This network is not connected to the internet at all. Each laptop has internet via free wifi and local connection.
    For devices like iphones that have no ethernet or other method.. you could use local wireless and public wireless.. but in turns.. still the only advantage is less issues with double NAT.. if that causes problems.. then this is an alternative.

Maybe you are looking for