[
https://issues.apache.org/jira/browse/CAMEL-24854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-24854.
---------------------------------
Fix Version/s: 4.23.0
Resolution: Fixed
> camel-jbang - the validator reports an include/exclude regex with a doubled
> backslash in single quotes, which matches a literal backslash and so no file
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24854
> URL: https://issues.apache.org/jira/browse/CAMEL-24854
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Priority: Major
> Fix For: 4.23.0
>
>
> (Corrected: the validator's backslash hint is right, it says to write
> {{'.*\\.json$'}} with one backslash. What went wrong is the next step.)
> After the hint for {{include: ".*\\.json$"}} (an unknown escape in double
> quotes), the model wrote
> {code:yaml}
> include: '.*\\\\.json$'
> {code}
> doubling the backslash as a Java string would, and inside single quotes YAML
> keeps both: the regex {{.*\\\\.json$}} matches a file name containing a
> literal backslash, so no file matched and the route ran ten seconds in
> silence (series l3, content-based-router). A person used to Java strings
> makes the same slip.
> The endpoint checks (EndpointChecks.checkRegexOptions, which already parses
> include/exclude/antInclude on the file components) should report a value with
> a doubled backslash: "include=.*\\\\.json$ matches a backslash in the file
> name (in single quotes one backslash escapes the dot): write
> include='.*\\.json$'". A test next to the regex option tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)