xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Kolpackov (JIRA)" <xerces-c-...@xml.apache.org>
Subject [jira] Closed: (XERCESC-1910) The RegularExpression 'matches' function no longer returns the start and end position of a match
Date Sun, 11 Apr 2010 11:16:41 GMT

     [ https://issues.apache.org/jira/browse/XERCESC-1910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Boris Kolpackov closed XERCESC-1910.
------------------------------------


Assuming this is fixed since 3.1.0.

> The RegularExpression 'matches' function no longer returns the start and end position
of a match
> ------------------------------------------------------------------------------------------------
>
>                 Key: XERCESC-1910
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1910
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 3.0.1
>         Environment: Windows
>            Reporter: Steve Roberts
>             Fix For: 3.1.0
>
>
> We have recently upgraded from version 2.2.0 to version 3.0.1. Between these versions
a change was made to the RegularExpression::matchUnion function, so that it now uses a local
version of the context structure. The result of this is that the 'fMatch' member of the context
can be changed from its original instance. Therefore, back in the RegularExpression::matches
function, just before it returns, it sets the start and end position of the match:
>             context.fMatch->setStartPos(0, (int)matchStart);
>             context.fMatch->setEndPos(0, matchEnd);
> However, the 'fMatch' object no longer matches the one that was passed through to function
(due to what happened in 'matchUnion') and therefore these values don't get returned to the
calling function.
> Therefore, I think that in the 'matches' function is should actually be setting the start
and end position of the 'pMatch' property that is passed into the function, rather than the
'context.fMatch'.
> The code we are using to call the regular expression is this:
>   XERCES_CPP_NAMESPACE::RegularExpression re(expression.c_str());
>   if( re.matches( text, &match ) )
>   { ...
> where expression = "([\-\(]?\d{1,3}([, ]\d{3})+\.\d+[\)]?|[\-\(]?\d+\.\d+[\)]?).*"
> and text = "13.13"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Mime
View raw message