railsc
cannot use helpers.strip_tags when playing scripts.
If you try to remove the html tag with gsub and regular expression, a new line code of "/n" will also be included
I want to erase the html tag without /n
in the middle below
<p>Yamada/n Taro</p>
By describing this regular expression, html tags (p tags) can be removed, but "/n" can also be removed altogether.
User.first.User_name.gsub(/<("[^"]*"|'[^']*'|[^'">])*>/, "")
Tried the description except "/n" before specifying the html tag.
I can't remove it well.
User.first.User_name.gsub(^(?!.*/n).$/<("[^"]*"|'[^']*'|'[^']*'|[^'">])*>/, "")
The condition is
Remove tags
remove a tag
I'm in trouble because I can't use regular expressions well.
If you have any knowledge, I would appreciate it if you could let me know.
Actually,
If you play scripts in railsc, helpers.trip_tags are not available.
It doesn't mean that inside the console,
include ActionView::Helpers::SanitizeHelper
Then the trip_tags
method can be called.
727 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
549 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
550 PHP ssh2_scp_send fails to send files as intended
540 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.