I want to escape を in Golang.

Asked 2 years ago, Updated 2 years ago, 60 views

I escaped the 記号 symbol using the regular expression in Golang as shown below, but I cannot.If you specify the マーク mark, you can do it on Playground, but is it not possible to do it on \?

https://play.golang.org/p/WG5IpwgCN9

go regular-expression

2022-09-30 16:13

1 Answers

\(BACKSLASH) and ((YEN SIGN) are assigned different codes...

\ is 0x5c and < is 0xa5 (0xc2a5 in UTF-8).

If you do not want to use <, you can also use regexp.Compile(`\xa5|,`).

--From Comments


2022-09-30 16:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.