Quantcast

Newbe: escaping especial chars

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Newbe: escaping especial chars

svampa
= Question =
// how to escape the + continuation
// the only thing that worked was adding a {sp}
// Any hint?

* string operators: +
* string operators: \+
* string operators: +{sp}
* Numeric operators: + - / *
* boolean operators: and or not xor

[cols="3,3,10"]
|==============================
|Match | return | Selected part of regular expression

// first brakets disappear. Why?

|0 miss brackets
|' Cliente: 12446 '
| [red]#(( Cliente:)\|( Client:)\|( Customer:))\s*([0..9]+)\s#

// Escaping first braket solves the problem
|0
|' Cliente: 12446 '
| [red]#\(( Cliente:)\|( Client:)\|( Customer:))\s*([0..9]+)\s#

//
|3 miss brakets
|''
| (( Cliente:)\|[red]#( Client:)#\|( Customer:))\s*([0..9]+)\s


// Once again I have to escape the first braket
|3
|''
| \(( Cliente:)\|[red]#( Client:)#\|( Customer:))\s*([0..9]+)\s

// But here I needn't to escape the braket. Why?
|4
|''
| (( Cliente:)\|( Client:)\|[red]#( Customer:)#)\s*([0..9]+)\s

|==============================
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbe: escaping especial chars

ggrossetie
Hello,

As you know "plus" is a special character in Asciidoctor, if you want to display "+" you should use "{plus}":


* string operators: {plus}
* string operators: {plus}
* string operators: {plus}
* Numeric operators: {plus} - / *
* boolean operators: and or not xor

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbe: escaping especial chars

svampa
Ok thanks

And what about the brackets, the parentheses, in the table? Why do the initial parentheses disappear?
Ted
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbe: escaping especial chars

Ted
svampa wrote
And what about the brackets, the parentheses, in the table? Why do the initial parentheses disappear?

// But here I needn't to escape the braket. Why?
(( Cliente:)\|( Client:)\|[red]#( Customer:)#)\s*([0..9]+)\s
It seems when there are two parenthesis (( ... )) it causes them to disappear, but I don't know why.

If you add anything like a space ( ( ... )) or (( ... )#)  like you did, this prevents it.

It doesn't matter if this is in a table or not.
- Ted @TedAtCIS
Loading...