Notice: This site is currently in beta. It may break at any time, and all URLs are subject to change.
こんにちは、ミドルウェア開発チームの青木です。 先日、アプリケーションサーバーが応答を返さなくなるトラブルに遭遇しました。 今回はその時のトラブルの原因と対策の顛末についてお話しようと思います。 現象 アプリケーションサーバーが突如応答を返さなくなりました。 現象が発生したアプリケーションサーバーのスタックトレースを見ると、あるスレッドの先頭が上記のようになっていました。 "qtp258153142-514386" prio=10 tid=0x00007f40b8dbf000 nid=0x7b4e runnable [0x00007f415ccb0000] java.lang.Thread.State: RUNNABLE at java.util.regex.Pattern$Loop.match(Pattern.java:4692) at java.util.regex.Pattern$G
Today we’re announcing the public release of RE2/J: a pure-Java implementation of the popular RE2 regular expression library. Although RE2/J is not always faster than java.util.regexp, its running time is always linear in the size of the input. Thus when matching larger inputs, especially against patterns containing a high degree of alternation, RE2/J may be dramatically faster. With a backtrackin
(Update: August 2011) As geofflane mentions in his answer, Java 7 now support named groups. tchrist points out in the comment that the support is limited. He details the limitations in his great answer "Java Regex Helper" Java 7 regex named group support was presented back in September 2010 in Oracle's blog. In the official release of Java 7, the constructs to support the named capturing group are
To clarify, I’m looking for a decent regular expression to validate URLs that were entered as user input with. I have no interest in parsing a list of URLs from a given string of text (even though some of the regexes on this page are capable of doing that). I also don’t want to allow every possible technically valid URL — quite the opposite. See the URL Standard if you’re looking to parse URLs in
PALADIN VPN Free VPN for Portugal to protect your privacy Why use a VPN? There are many reasons to use a VPN below we summarized the most important reasons. Protect your privacy and identity Security on public wifi Security when working remotely Access any content from anywhere Protect your data from governments, service providers, and apps According to Wikipedia A virtual private network (VPN) ex
おっと、これは便利かも。 REGEXPERを使えば、JavaScriptの正規表現をわかりやすく表現してくれる。 一見、難解な正規表現だが、これを通しても見ると「なるほど、この文字とこの文字にはされまれていて、この間は何の文字でも良いのだな」といったことがわかるようになる。 他の人のコードを読んでいて「?」となったときに試してみてもいいかもですな。
問題 VimとExcelを組み合わせて全く新しいSQLクエリーを生成する でも述べたように、諸事情で Excel を使う機会はよくあるのですが、 その時に困るのが文字列処理です。 Excel は組み込みでCLEAN、TRIM、UPPER、PHONETICなどの豊富な関数が用意されているものの、 何故か正規表現を使った文字列比較や文字列置換は標準で関数が用意されていません。 単純な処理ならば組み込み関数を組み合わせてどうにかできるものの、 「s/,+/,/g や s/,$// ができたらなぁ……」 と思うことはしばしばあります。 どうにかして Excel の数式で正規表現を使うことはできないでしょうか。 解答 結論から言うと、デフォルトの状態では正規表現を使うことはできません。 しかし以下のステップを踏むことで正規表現が利用できます (以下の例では Excel 2007 を使用しています)。
たぶんここらへん[NDO::Weblog]とかここらへん[module.jp]を参考にしたんだと思うんだけど・・・ 1. 拡張クラスを作る org.apache.struts.validator.FieldChecks を継承したクラスを作る。 private static final String P_HIRAGANA_ONLY のところは java.util.regexの正規表現によるUnicodeブロックで定義されているものを使うと幸せ。 ↓こんなんとか \p{InHiragana} ひらがな \p{InKatakana} カタカナ \p{InHalfwidthAndFullwidthForms} 半角カタカナ \p{InCJKUnifiedIdeographs} 漢字 package myClass.validator; import java.util.regex.Matcher
Guides, HowTos and Tips for Technology Geeks - The Geek Stuff LinuxやFreeBSDなどのUnix系OSを使う場合に必須になるコマンドのひとつにgrep(1)がある。grep(1)は指定した文字列をファイルや標準入力から抜き出したり、またその逆の処理を行うなどの目的で利用されるコマンド。特定のキーワードを指定してファイルを特定するために利用されるほか、コマンド出力を加工したり、データを加工したりといった用途で使われている。 grep(1)はキーワードの指定に正規表現を指定できる。正規表現はgrep(1)の活用範囲をきわめて広くする重要な機能であり、grep(1)の基本的な使い方をマスターした後にぜひ習得しておきたい機能といえる。The Geek StuffのAdvanced Regular Expressions in Gr
RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp). Supports JavaScript & PHP/PCRE RegEx. Results update in real-time as you type. Roll over a match or expression for details. Validate patterns with suites of Tests. Save & share expressions with others. Use Tools to explore your results. Full RegEx Reference with help & examples. Undo & Redo with {{getCtrlKey()}}
「前のエントリで書き忘れてた - 最速チュパカブラ研究会」にて、Narcissus で使われている正規表現が参考になるという話が出ています。 文字列リテラル /^"(?:\\.|[^"])*"|^'(?:[^']|\\.)*'/ 正規表現リテラル /^\/((?:\\.|[^\/])+)\/([gimy]*)/ コメント /^\/(?:\*(?:.|\n)*?\*\/|\/.*)/ 一流の人が書いたものを使いましょうというのに異を唱えるつもりはありませんが、そのままコピー & ペーストしていては意味がありません。ここはやはり一文字一文字心をこめて写経しましょう……ではなく、どうしてその書き方でうまくいくのかをきちんと考えた上で使いましょう。 文字列リテラルにマッチする正規表現 上記の文字列リテラルを表す正規表現から、一重引用符でくくられた文字列にマッチする部分だけを抜き出すと '(?:[^
isogawaです。 題名のままのコードを書く用事があったので、できたものを晒します。とはいえ、ググれば多くの先達が既にさまざまなコードを書いておられ、目新しいものではないんですが。ついでなんで、大昔の「ISBN=~」を含めて、自分の知ってるURLのパターンを洗いなおしてみました(それでも、まだ他のパターンがありそうな気がしますが…)。 例えば、「The Elements of Style」という書籍の個別商品URLとして思いつくものには、以下のようなパターンがあります(細かいバリエーションは適宜省略)。 http://www.amazon.co.jp/exec/obidos/ASIN/020530902X http://www.amazon.co.jp/o/ASIN/020530902X http://www.amazon.co.jp/exec/obidos/ISBN=020530902
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く