You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by Srinivasan Krishnan <sr...@wipro.com> on 2002/08/16 00:18:29 UTC
Nonquoted expression
Hi
Sorry for my limited knowledge in RegEXp. I could find a lot of Geeks in
Discussion forum. please teach me the below
My java RegExp is "([a-z]+)\\s*=\\s*\"([^\"]+)\"" is the expression i
use to extract all the Key = values pair in the string
face="Arial, Serif" size="+2" color="red "
But how ever this approach fails when the value is not quoted . when i
use RegExp \\s*([a-z]+)\\s*=\\s*([^\\s]*)\\s* this works for unquoted
String values
such as
face="Arial, Serif" size=+2 color="red "
but fails when my input string is
face=Arial Serif size="+2" color="red "
How to write a REGEXp such that accepts the unquoted values as well as
space in between the values.
regards,
srini SK