---
# System prepended metadata

title: '[ruby][regex]除去url後面的#值'
tags: [regex, ruby]

---

# [ruby][regex]除去url後面的#值

###### tags: `ruby`,`regex`

[codewar](https://www.codewars.com)


```ruby
url="www.codewars.com#about"
p url[/[^#]+/] #=>"www.codewars.com"
```
