regex « Development « Spring Q&A





1. Parse request URL in JSTL    stackoverflow.com

I want to display a specific message based on the URL request on a JSP. the request URL can be:

/app/cars/{id}
OR
/app/people/{id}
On my messages.properties I've got:
events.action.cars=My car {0} event
events.action.people=My person {1} event
Finally, on ...

2. How to set a regex string with spring without it being escaped?    stackoverflow.com

I'm using spring for setting my regular expression spring:

<property name="regularExpressionAsString" value="(?&lt;!\\.TMP)\\Z" />
code:
public void setRegularExpressionAsString(String regularEx) {
    this.regularExpression = Pattern.compile(regularEx);
}
This doesn't work properly and when I debug my setter I've ...

3. Can someone check this regex statement please?    stackoverflow.com

I just need to verify that this regex statement will do what I want. Given the following json string

{"a":"1","Provider":"WebHook","b":"2"}
I need to ensure that the following regex
(?<=\bProvider":")\w+
Will always return the word following the ...

4. Spring's AntPathMatcher matching behavior with linux paths    stackoverflow.com

I came across this weird behavior from AntPathMatcher, which I isolated in the unit test below:

@Test
    public void testAntPathMacherPotentiallyBrokenForNix() throws IOException {
     ...

5. Check if url equals or is a sub-directory of?    stackoverflow.com

I am looking for a best-practice way of doing the following in java (perhaps using apache commons, some spring utility, or maybe just plain java/regex): I need to check if a given ...

6. Regex Validation only works with one single Character    stackoverflow.com

I want to check if a userInput is free from special characters, here is my code:

public class ValidateHelper {

public boolean userInputContainsNoSpecialCharacters(String input){

        Pattern p ...

7. Apache Camel Regex Operator not matching    stackoverflow.com

I'm trying to use Apache Camel (with Spring XML) to check if a message body matches a regex:

<when>
    <simple>${body} regex 'https?://(?:www\.)?twitter\.com[^\w]+'</simple>
    <to uri="activemq:queue:test"/>
</when>
So http://www.twitter.com/user in ...

8. JSP, Spring framework - regular expression form validation    stackoverflow.com

Is there a regular expression that can match 2 fields like: If I had a password and confirm password field, Is there a regexp that can match the 2 fields before the ...

9. Data Validation - Regular expression    stackoverflow.com

I am working on a registration form, where i am providing validation(spring) for input (user)data. I have fields like Name (Full Name) Only Characters are allowed -> Acceptable values are : A, AB, A ...





10. Angle bracket in XML regex not matching    stackoverflow.com

I have a regex stored within an Apache Camel XML file:

<simple>${body} regex '\s*&lt;+.*'</simple>
I am trying to match the string:
&lt;?xml
(the first part of an encoded XML file) i.e. literally the characters &lt;. The Problem ...

11. regex pattern in xsd    forum.springsource.org

Hello Has anybody run into a problem validating a soap payload using regex patterns in the wsdl with a spring dispatcher? I am running an app with metro artifacts. jax-ws 2.1 ...

12. java regexp    forum.springsource.org

13. FilterChainProxy and use of RegExp matcher    forum.springsource.org

FilterChainProxy and use of RegExp matcher I posted this message on the mail list, and received no response - so I am posting it here as well. Currently, the regexp matching ...

14. handlerMapping and Pattern Matching (Regex)    forum.springsource.org

Hello I have two Urls that need to go to two different Controllers The first one is "/mypath/myFirst" myFirstController The second one will match any letter mySecondController If ...

15. Validating a Float with regexp?    forum.springsource.org

Validating a Float with regexp? Hello I'm trying to validate a Float private final Constraint DRAUGHT_CONSTRAINT = all(new Constraint[] { new regexp( "/^\\d{0,2}(\\.\\d{0,2})?$/"), "xxx" }); ... add("draught", DRAUGHT_CONSTRAINT); But regexp.test is ...

16. RegExp Problem with {} in 1.1.0.M1    forum.springsource.org

Currently, I got trouble defining a regExp with curly brackets in 1.1.0.M1. Example pattern (taken from ROO-639: @Pattern(regexp="\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[a-zAZ]{2,4}\\b") which causes this error: Code: java.lang.IllegalArgumentException: unknown format type at at java.text.MessageFormat.makeFormat(MessageFormat.java:1442) at ...





17. Support of regex in header-value-router    forum.springsource.org

Support of regex in header-value-router Hi, Do you think it might be possible to add regex support on the tag ? Like instead of : Code: ...